Commit e49f0de9 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #14256 from linzichang/fixup-guestbook

Auto commit by PR queue bot
parents 3e5589c1 2afda9f2
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
# type: LoadBalancer
ports:
# the port that this service should serve on
- port: 80
selector:
app: guestbook
tier: frontend
---
apiVersion: v1
kind: ReplicationController
metadata:
name: frontend
# these labels can be applied automatically
# from the labels in the pod template if not set
labels:
app: guestbook
tier: frontend
spec:
# this replicas value is default
# modify it according to your case
replicas: 3
# selector can be applied automatically
# from the labels in the pod template if not set
# selector:
# app: guestbook
# tier: frontend
template:
metadata:
labels:
app: guestbook
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google_samples/gb-frontend:v3
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
# If your cluster config does not include a dns service, then to
# instead access environment variables to find service host
# info, comment out the 'value: dns' line above, and uncomment the
# line below.
# value: env
ports:
- containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: redis-master
labels:
app: redis
tier: backend
role: master
spec:
ports:
# the port that this service should serve on
- port: 6379
targetPort: 6379
selector:
app: redis
tier: backend
role: master
---
apiVersion: v1
kind: ReplicationController
metadata:
name: redis-master
# these labels can be applied automatically
# from the labels in the pod template if not set
labels:
app: redis
role: master
tier: backend
spec:
# this replicas value is default
# modify it according to your case
replicas: 1
# selector can be applied automatically
# from the labels in the pod template if not set
# selector:
# app: guestbook
# role: master
# tier: backend
template:
metadata:
labels:
app: redis
role: master
tier: backend
spec:
containers:
- name: master
image: redis
resources:
requests:
cpu: 100m
memory: 100Mi
ports:
- containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
name: redis-slave
labels:
app: redis
tier: backend
role: slave
spec:
ports:
# the port that this service should serve on
- port: 6379
selector:
app: redis
tier: backend
role: slave
---
apiVersion: v1
kind: ReplicationController
metadata:
name: redis-slave
# these labels can be applied automatically
# from the labels in the pod template if not set
labels:
app: redis
role: slave
tier: backend
spec:
# this replicas value is default
# modify it according to your case
replicas: 2
# selector can be applied automatically
# from the labels in the pod template if not set
# selector:
# app: guestbook
# role: slave
# tier: backend
template:
metadata:
labels:
app: redis
role: slave
tier: backend
spec:
containers:
- name: slave
image: gcr.io/google_samples/gb-redisslave:v1
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
# If your cluster config does not include a dns service, then to
# instead access an environment variable to find the master
# service's host, comment out the 'value: dns' line above, and
# uncomment the line below.
# value: env
ports:
- containerPort: 6379
---
apiVersion: v1
kind: Service
metadata:
name: frontend
labels:
app: guestbook
tier: frontend
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
# type: LoadBalancer
ports:
# the port that this service should serve on
- port: 80
selector:
app: guestbook
tier: frontend
---
apiVersion: v1
kind: ReplicationController
metadata:
name: frontend
# these labels can be applied automatically
# from the labels in the pod template if not set
labels:
app: guestbook
tier: frontend
spec:
# this replicas value is default
# modify it according to your case
replicas: 3
# selector can be applied automatically
# from the labels in the pod template if not set
# selector:
# app: guestbook
# tier: frontend
template:
metadata:
labels:
app: guestbook
tier: frontend
spec:
containers:
- name: php-redis
image: gcr.io/google_samples/gb-frontend:v3
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
# If your cluster config does not include a dns service, then to
# instead access environment variables to find service host
# info, comment out the 'value: dns' line above, and uncomment the
# line below.
# value: env
ports:
- containerPort: 80
apiVersion: v1
kind: Service
metadata:
name: redis-slave
labels:
app: redis
role: slave
tier: backend
spec:
ports:
# the port that this service should serve on
- port: 6379
selector:
app: redis
role: slave
tier: backend
---
apiVersion: v1
kind: ReplicationController
metadata:
name: redis-slave
# these labels can be applied automatically
# from the labels in the pod template if not set
labels:
app: redis
role: slave
tier: backend
spec:
# this replicas value is default
# modify it according to your case
replicas: 2
# selector can be applied automatically
# from the labels in the pod template if not set
# selector:
# app: guestbook
# role: slave
# tier: backend
template:
metadata:
labels:
app: redis
role: slave
tier: backend
spec:
containers:
- name: slave
image: gcr.io/google_samples/gb-redisslave:v1
resources:
requests:
cpu: 100m
memory: 100Mi
env:
- name: GET_HOSTS_FROM
value: dns
# If your cluster config does not include a dns service, then to
# instead access an environment variable to find the master
# service's host, comment out the 'value: dns' line above, and
# uncomment the line below.
# value: env
ports:
- containerPort: 6379
...@@ -2,20 +2,33 @@ apiVersion: v1 ...@@ -2,20 +2,33 @@ apiVersion: v1
kind: ReplicationController kind: ReplicationController
metadata: metadata:
name: frontend name: frontend
# these labels can be applied automatically
# from the labels in the pod template if not set
labels: labels:
name: frontend app: guestbook
tier: frontend
spec: spec:
# this replicas value is default
# modify it according to your case
replicas: 3 replicas: 3
selector: # selector can be applied automatically
name: frontend # from the labels in the pod template if not set
# selector:
# app: guestbook
# tier: frontend
template: template:
metadata: metadata:
labels: labels:
name: frontend app: guestbook
tier: frontend
spec: spec:
containers: containers:
- name: php-redis - name: php-redis
image: gcr.io/google_samples/gb-frontend:v3 image: gcr.io/google_samples/gb-frontend:v3
resources:
requests:
cpu: 100m
memory: 100Mi
env: env:
- name: GET_HOSTS_FROM - name: GET_HOSTS_FROM
value: dns value: dns
......
...@@ -3,13 +3,15 @@ kind: Service ...@@ -3,13 +3,15 @@ kind: Service
metadata: metadata:
name: frontend name: frontend
labels: labels:
name: frontend app: guestbook
tier: frontend
spec: spec:
# if your cluster supports it, uncomment the following to automatically create # if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service. # an external load-balanced IP for the frontend service.
# type: LoadBalancer # type: LoadBalancer
ports: ports:
# the port that this service should serve on # the port that this service should serve on
- port: 80 - port: 80
selector: selector:
name: frontend app: guestbook
tier: frontend
...@@ -2,19 +2,35 @@ apiVersion: v1 ...@@ -2,19 +2,35 @@ apiVersion: v1
kind: ReplicationController kind: ReplicationController
metadata: metadata:
name: redis-master name: redis-master
# these labels can be applied automatically
# from the labels in the pod template if not set
labels: labels:
name: redis-master app: redis
role: master
tier: backend
spec: spec:
# this replicas value is default
# modify it according to your case
replicas: 1 replicas: 1
selector: # selector can be applied automatically
name: redis-master # from the labels in the pod template if not set
# selector:
# app: guestbook
# role: master
# tier: backend
template: template:
metadata: metadata:
labels: labels:
name: redis-master app: redis
role: master
tier: backend
spec: spec:
containers: containers:
- name: master - name: master
image: redis image: redis
resources:
requests:
cpu: 100m
memory: 100Mi
ports: ports:
- containerPort: 6379 - containerPort: 6379
...@@ -3,11 +3,15 @@ kind: Service ...@@ -3,11 +3,15 @@ kind: Service
metadata: metadata:
name: redis-master name: redis-master
labels: labels:
name: redis-master app: redis
role: master
tier: backend
spec: spec:
ports: ports:
# the port that this service should serve on # the port that this service should serve on
- port: 6379 - port: 6379
targetPort: 6379 targetPort: 6379
selector: selector:
name: redis-master app: redis
role: master
tier: backend
...@@ -2,20 +2,36 @@ apiVersion: v1 ...@@ -2,20 +2,36 @@ apiVersion: v1
kind: ReplicationController kind: ReplicationController
metadata: metadata:
name: redis-slave name: redis-slave
# these labels can be applied automatically
# from the labels in the pod template if not set
labels: labels:
name: redis-slave app: redis
role: slave
tier: backend
spec: spec:
# this replicas value is default
# modify it according to your case
replicas: 2 replicas: 2
selector: # selector can be applied automatically
name: redis-slave # from the labels in the pod template if not set
# selector:
# app: guestbook
# role: slave
# tier: backend
template: template:
metadata: metadata:
labels: labels:
name: redis-slave app: redis
role: slave
tier: backend
spec: spec:
containers: containers:
- name: worker - name: slave
image: gcr.io/google_samples/gb-redisslave:v1 image: gcr.io/google_samples/gb-redisslave:v1
resources:
requests:
cpu: 100m
memory: 100Mi
env: env:
- name: GET_HOSTS_FROM - name: GET_HOSTS_FROM
value: dns value: dns
......
...@@ -3,10 +3,14 @@ kind: Service ...@@ -3,10 +3,14 @@ kind: Service
metadata: metadata:
name: redis-slave name: redis-slave
labels: labels:
name: redis-slave app: redis
role: slave
tier: backend
spec: spec:
ports: ports:
# the port that this service should serve on # the port that this service should serve on
- port: 6379 - port: 6379
selector: selector:
name: redis-slave app: redis
role: slave
tier: backend
...@@ -56,9 +56,9 @@ const ( ...@@ -56,9 +56,9 @@ const (
kittenImage = "gcr.io/google_containers/update-demo:kitten" kittenImage = "gcr.io/google_containers/update-demo:kitten"
updateDemoSelector = "name=update-demo" updateDemoSelector = "name=update-demo"
updateDemoContainer = "update-demo" updateDemoContainer = "update-demo"
frontendSelector = "name=frontend" frontendSelector = "app=guestbook,tier=frontend"
redisMasterSelector = "name=redis-master" redisMasterSelector = "app=redis,role=master"
redisSlaveSelector = "name=redis-slave" redisSlaveSelector = "app=redis,role=slave"
goproxyContainer = "goproxy" goproxyContainer = "goproxy"
goproxyPodSelector = "name=goproxy" goproxyPodSelector = "name=goproxy"
netexecContainer = "netexec" netexecContainer = "netexec"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment