...
1---
2apiVersion: v1
3kind: Service
4metadata:
5 name: redis-master
6 labels:
7 app: redis
8 tier: backend
9 role: master
10spec:
11 ports:
12 # the port that this service should serve on
13 - port: 6379
14 targetPort: 6379
15 selector:
16 app: redis
17 tier: backend
18 role: master
19---
20apiVersion: v1
21kind: ReplicationController
22metadata:
23 name: redis-master
24 # these labels can be applied automatically
25 # from the labels in the pod template if not set
26 labels:
27 app: redis
28 role: master
29 tier: backend
30spec:
31 # this replicas value is default
32 # modify it according to your case
33 replicas: 1
34 # selector can be applied automatically
35 # from the labels in the pod template if not set
36 # selector:
37 # app: guestbook
38 # role: master
39 # tier: backend
40 template:
41 metadata:
42 labels:
43 app: redis
44 role: master
45 tier: backend
46 spec:
47 containers:
48 - name: master
49 image: redis
50 resources:
51 requests:
52 cpu: 100m
53 memory: 100Mi
54 ports:
55 - containerPort: 6379
56---
57apiVersion: v1
58kind: Service
59metadata:
60 name: redis-slave
61 labels:
62 app: redis
63 tier: backend
64 role: slave
65spec:
66 ports:
67 # the port that this service should serve on
68 - port: 6379
69 selector:
70 app: redis
71 tier: backend
72 role: slave
73---
74apiVersion: v1
75kind: ReplicationController
76metadata:
77 name: redis-slave
78 # these labels can be applied automatically
79 # from the labels in the pod template if not set
80 labels:
81 app: redis
82 role: slave
83 tier: backend
84spec:
85 # this replicas value is default
86 # modify it according to your case
87 replicas: 2
88 # selector can be applied automatically
89 # from the labels in the pod template if not set
90 # selector:
91 # app: guestbook
92 # role: slave
93 # tier: backend
94 template:
95 metadata:
96 labels:
97 app: redis
98 role: slave
99 tier: backend
100 spec:
101 containers:
102 - name: slave
103 image: gcr.io/google_samples/gb-redisslave:v1
104 resources:
105 requests:
106 cpu: 100m
107 memory: 100Mi
108 env:
109 - name: GET_HOSTS_FROM
110 value: dns
111 # If your cluster config does not include a dns service, then to
112 # instead access an environment variable to find the master
113 # service's host, comment out the 'value: dns' line above, and
114 # uncomment the line below.
115 # value: env
116 ports:
117 - containerPort: 6379
118---
119apiVersion: v1
120kind: Service
121metadata:
122 name: frontend
123 labels:
124 app: guestbook
125 tier: frontend
126spec:
127 # if your cluster supports it, uncomment the following to automatically create
128 # an external load-balanced IP for the frontend service.
129 # type: LoadBalancer
130 ports:
131 # the port that this service should serve on
132 - port: 80
133 selector:
134 app: guestbook
135 tier: frontend
136---
137apiVersion: v1
138kind: ReplicationController
139metadata:
140 name: frontend
141 # these labels can be applied automatically
142 # from the labels in the pod template if not set
143 labels:
144 app: guestbook
145 tier: frontend
146spec:
147 # this replicas value is default
148 # modify it according to your case
149 replicas: 3
150 # selector can be applied automatically
151 # from the labels in the pod template if not set
152 # selector:
153 # app: guestbook
154 # tier: frontend
155 template:
156 metadata:
157 labels:
158 app: guestbook
159 tier: frontend
160 spec:
161 containers:
162 - name: php-redis
163 image: gcr.io/google_samples/gb-frontend:v3
164 resources:
165 requests:
166 cpu: 100m
167 memory: 100Mi
168 env:
169 - name: GET_HOSTS_FROM
170 value: dns
171 # If your cluster config does not include a dns service, then to
172 # instead access environment variables to find service host
173 # info, comment out the 'value: dns' line above, and uncomment the
174 # line below.
175 # value: env
176 ports:
177 - containerPort: 80
178---
179---
180# an empty resource with comments
181---
View as plain text