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