代码拉取完成,页面将自动刷新
同步操作将从 恰衕嶨少年/redis-cluster-on-k8s 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: redis-cluster-data-ips-claim
namespace: test
spec:
accessModes:
- ReadWriteMany
storageClassName: ceph-fs-gd-1
resources:
requests:
storage: 100Mi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-conf
namespace: test
data:
redis.conf: |
port 6379
dir /data
daemonize yes
cluster-enabled yes
cluster-node-timeout 15000
cluster-config-file nodes.conf
appendonly yes
appendfilename "appendonly.aof"
protected-mode no
---
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: redis-cluster-pdb
namespace: test
spec:
selector:
matchLabels:
app: redis-cluster
maxUnavailable: 1
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis-cluster
namespace: test
spec:
serviceName: redis-cluster-hs
replicas: 6
selector:
matchLabels:
app: redis-cluster
updateStrategy:
type: RollingUpdate
podManagementPolicy: Parallel
template:
metadata:
labels:
app: redis-cluster
spec:
#affinity:
#podAntiAffinity:
#requiredDuringSchedulingIgnoredDuringExecution:
#- labelSelector:
# matchExpressions:
# - key: "app"
# operator: In
# values:
#- redis-cluster
#topologyKey: "kubernetes.io/hostname"
containers:
- name: redis-cluster
image: 172.168.27.239/devops/redis:5.0.8-cluster
imagePullPolicy: Always
command: ["/usr/local/bin/start.sh"]
# command: ["redis-server"]
# args: ["/etc/redis/redis.conf","--cluster-announce-ip","$(MY_POD_IP)"]
resources:
limits:
cpu: 0.5
memory: 512Mi
requests:
cpu: 0.1
memory: 100Mi
ports:
- containerPort: 6379
name: port1
protocol: TCP
volumeMounts:
- name: data
mountPath: "/data"
- name: redis-conf
mountPath: "/etc/redis/"
- name: data-ips
mountPath: "/data-ips"
env:
- name: TZ
value: "Asia/Shanghai"
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
volumes:
- name: data-ips
persistentVolumeClaim:
claimName: redis-cluster-data-ips-claim
- name: redis-conf
configMap:
name: redis-conf
items:
- key: redis.conf
path: redis.conf
initContainers:
- name: init-redis
image: 172.168.27.239/devops/busybox:1.28.3
command:
- sh
- -c
- |
ulimit -n 65536
echo 511 > /proc/sys/net/core/somaxconn
echo 'vm.overcommit_memory=1' > /etc/sysctl.conf
mount -o remount rw /sys
echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled
echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag
securityContext:
privileged: true
volumeClaimTemplates:
- metadata:
name: data
labels:
app: redis-cluster
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: ceph-rbd-gd-1
resources:
requests:
storage: 1Gi
---
kind: Service
apiVersion: v1
metadata:
name: redis-cluster-hs
namespace: test
labels:
app: redis-cluster
spec:
selector:
app: redis-cluster
clusterIP: None
ports:
- port: 6379
targetPort: 6379
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。