...
1apiVersion: apps/v1
2kind: ReplicaSet
3metadata:
4 name: redis-slave
5 labels:
6 app: redis
7 role: slave
8 tier: backend
9spec:
10 # this replicas value is default
11 # modify it according to your case
12 replicas: 2
13 selector:
14 matchLabels:
15 app: redis
16 role: slave
17 tier: backend
18 template:
19 metadata:
20 labels:
21 app: redis
22 role: slave
23 tier: backend
24 spec:
25 containers:
26 - name: slave
27 image: gcr.io/google_samples/gb-redisslave:v1
28 resources:
29 requests:
30 cpu: 100m
31 memory: 100Mi
32 env:
33 - name: GET_HOSTS_FROM
34 value: dns
35 # If your cluster config does not include a dns service, then to
36 # instead access an environment variable to find the master
37 # service's host, comment out the 'value: dns' line above, and
38 # uncomment the line below.
39 # value: env
40 ports:
41 - containerPort: 6379
View as plain text