forked from sarweshsuman/redis-sentinel-ha-k8s-deployment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-slave-deployment.yaml
55 lines (48 loc) · 1.26 KB
/
create-slave-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis-ha-cluster-redis-slave-d1
spec:
replicas: 1
selector:
matchLabels:
app: redis-ha-cluster-redis-slave-lbl
template:
metadata:
name: redis-ha-cluster-redis-slave-p1
labels:
app: redis-ha-cluster-redis-slave-lbl
slave: "true"
spec:
# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: master
# operator: In
# values:
# - "true"
# topologyKey: "kubernetes.io/hostname"
volumes:
- hostPath:
path: /tmp/data/2
name: redis-directory-binding
restartPolicy: Always
containers:
- name: redis-ha-cluster-redis-c1
image: redis-sentinel-ha-cluster:1.0
resources:
requests:
memory: "100Mi"
cpu: .2
limits:
memory: "200Mi"
cpu: .5
imagePullPolicy: IfNotPresent
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /redis-data
name: redis-directory-binding
readOnly: false