forked from sarweshsuman/redis-sentinel-ha-k8s-deployment
-
Notifications
You must be signed in to change notification settings - Fork 1
/
create-master-deployment.yaml
58 lines (51 loc) · 1.31 KB
/
create-master-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
56
57
58
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redis-ha-cluster-master-d1
spec:
replicas: 1
selector:
matchLabels:
app: redis-ha-cluster-redis-master-lbl
template:
metadata:
name: redis-ha-cluster-master-p1
labels:
app: redis-ha-cluster-redis-master-lbl
master: "true"
spec:
# affinity:
# podAntiAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# - labelSelector:
# matchExpressions:
# - key: slave
# operator: In
# values:
# - "true"
# topologyKey: "kubernetes.io/hostname"
volumes:
- hostPath:
path: /tmp/data/1
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
env:
- name: MASTER
value: "true"