Skip to content

Commit 46c2fb6

Browse files
authored
Merge pull request #28452 from jimangel/sync-guestbook-updates
Updating tutorial to match source
2 parents 304bf1b + ff0018b commit 46c2fb6

File tree

10 files changed

+252
-131
lines changed

10 files changed

+252
-131
lines changed

content/en/docs/tutorials/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Before walking through each tutorial, you may want to bookmark the
3535

3636
* [Exposing an External IP Address to Access an Application in a Cluster](/docs/tutorials/stateless-application/expose-external-ip-address/)
3737

38-
* [Example: Deploying PHP Guestbook application with MongoDB](/docs/tutorials/stateless-application/guestbook/)
38+
* [Example: Deploying PHP Guestbook application with Redis](/docs/tutorials/stateless-application/guestbook/)
3939

4040
## Stateful Applications
4141

content/en/docs/tutorials/stateless-application/guestbook.md

Lines changed: 138 additions & 66 deletions
Large diffs are not rendered by default.
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1+
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
12
apiVersion: apps/v1
23
kind: Deployment
34
metadata:
45
name: frontend
5-
labels:
6-
app.kubernetes.io/name: guestbook
7-
app.kubernetes.io/component: frontend
86
spec:
7+
replicas: 3
98
selector:
109
matchLabels:
11-
app.kubernetes.io/name: guestbook
12-
app.kubernetes.io/component: frontend
13-
replicas: 3
10+
app: guestbook
11+
tier: frontend
1412
template:
1513
metadata:
1614
labels:
17-
app.kubernetes.io/name: guestbook
18-
app.kubernetes.io/component: frontend
15+
app: guestbook
16+
tier: frontend
1917
spec:
2018
containers:
21-
- name: guestbook
22-
image: paulczar/gb-frontend:v5
23-
# image: gcr.io/google-samples/gb-frontend:v4
19+
- name: php-redis
20+
image: gcr.io/google_samples/gb-frontend:v5
21+
env:
22+
- name: GET_HOSTS_FROM
23+
value: "dns"
2424
resources:
2525
requests:
2626
cpu: 100m
2727
memory: 100Mi
28-
env:
29-
- name: GET_HOSTS_FROM
30-
value: dns
3128
ports:
32-
- containerPort: 80
29+
- containerPort: 80
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1+
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
12
apiVersion: v1
23
kind: Service
34
metadata:
45
name: frontend
56
labels:
6-
app.kubernetes.io/name: guestbook
7-
app.kubernetes.io/component: frontend
7+
app: guestbook
8+
tier: frontend
89
spec:
910
# if your cluster supports it, uncomment the following to automatically create
1011
# an external load-balanced IP for the frontend service.
1112
# type: LoadBalancer
13+
#type: LoadBalancer
1214
ports:
15+
# the port that this service should serve on
1316
- port: 80
1417
selector:
15-
app.kubernetes.io/name: guestbook
16-
app.kubernetes.io/component: frontend
18+
app: guestbook
19+
tier: frontend

content/en/examples/application/guestbook/mongo-deployment.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

content/en/examples/application/guestbook/mongo-service.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: redis-follower
6+
labels:
7+
app: redis
8+
role: follower
9+
tier: backend
10+
spec:
11+
replicas: 2
12+
selector:
13+
matchLabels:
14+
app: redis
15+
template:
16+
metadata:
17+
labels:
18+
app: redis
19+
role: follower
20+
tier: backend
21+
spec:
22+
containers:
23+
- name: follower
24+
image: gcr.io/google_samples/gb-redis-follower:v2
25+
resources:
26+
requests:
27+
cpu: 100m
28+
memory: 100Mi
29+
ports:
30+
- containerPort: 6379
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: redis-follower
6+
labels:
7+
app: redis
8+
role: follower
9+
tier: backend
10+
spec:
11+
ports:
12+
# the port that this service should serve on
13+
- port: 6379
14+
selector:
15+
app: redis
16+
role: follower
17+
tier: backend
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: redis-leader
6+
labels:
7+
app: redis
8+
role: leader
9+
tier: backend
10+
spec:
11+
replicas: 1
12+
selector:
13+
matchLabels:
14+
app: redis
15+
template:
16+
metadata:
17+
labels:
18+
app: redis
19+
role: leader
20+
tier: backend
21+
spec:
22+
containers:
23+
- name: leader
24+
image: "docker.io/redis:6.0.5"
25+
resources:
26+
requests:
27+
cpu: 100m
28+
memory: 100Mi
29+
ports:
30+
- containerPort: 6379
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SOURCE: https://cloud.google.com/kubernetes-engine/docs/tutorials/guestbook
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: redis-leader
6+
labels:
7+
app: redis
8+
role: leader
9+
tier: backend
10+
spec:
11+
ports:
12+
- port: 6379
13+
targetPort: 6379
14+
selector:
15+
app: redis
16+
role: leader
17+
tier: backend

0 commit comments

Comments
 (0)