forked from cqyisbug/redis-in-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sts-redis-master.yaml
49 lines (49 loc) · 1.17 KB
/
sts-redis-master.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
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: sts-redis-master
spec:
serviceName: "svc-redis-master"
replicas: 1
template:
metadata:
labels:
name: sts-redis-master
environment: test
spec:
terminationGracePeriodSeconds: 10
containers:
- name: cntr-redis-master
image: $YourImage
imagePullPolicy: Always
env:
- name: MASTER
value: "true"
- name: SENTINEL_HOST
value: sts-redis-sentinel-0.svc-redis-sentinel
- name: SENTINEL_PORT
value: "26379"
- name: MASTER_PORT
value: "6379"
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
ports:
- containerPort: 6379
volumeMounts:
- name: redismaster
mountPath: /data/redis
securityContext:
capabilities: {}
privileged: true
volumeClaimTemplates:
- metadata:
name: redismaster
annotations:
volume.beta.kubernetes.io/storage-class: "fast"
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi