Skip to content

Commit 4cb767d

Browse files
author
k0rventen
committed
add supporting files
1 parent 24a7c3f commit 4cb767d

File tree

6 files changed

+116
-0
lines changed

6 files changed

+116
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: backend
6+
spec:
7+
selector:
8+
matchLabels:
9+
app: hello
10+
tier: backend
11+
track: stable
12+
replicas: 3
13+
template:
14+
metadata:
15+
labels:
16+
app: hello
17+
tier: backend
18+
track: stable
19+
spec:
20+
containers:
21+
- name: hello
22+
image: "gcr.io/google-samples/hello-go-gke:1.0"
23+
ports:
24+
- name: http
25+
containerPort: 80
26+
...
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: hello
6+
spec:
7+
selector:
8+
app: hello
9+
tier: backend
10+
ports:
11+
- protocol: TCP
12+
port: 80
13+
targetPort: http
14+
...
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: frontend
6+
spec:
7+
selector:
8+
matchLabels:
9+
app: hello
10+
tier: frontend
11+
track: stable
12+
replicas: 1
13+
template:
14+
metadata:
15+
labels:
16+
app: hello
17+
tier: frontend
18+
track: stable
19+
spec:
20+
containers:
21+
- name: nginx
22+
image: "gcr.io/google-samples/hello-frontend:1.0"
23+
lifecycle:
24+
preStop:
25+
exec:
26+
command: ["/usr/sbin/nginx","-s","quit"]
27+
...
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# The identifier Backend is internal to nginx, and used to name this specific upstream
2+
upstream Backend {
3+
# hello is the internal DNS name used by the backend Service inside Kubernetes
4+
server hello;
5+
}
6+
7+
server {
8+
listen 80;
9+
10+
location / {
11+
# The following statement will proxy traffic to the upstream named Backend
12+
proxy_pass http://Backend;
13+
}
14+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: frontend
6+
spec:
7+
selector:
8+
app: hello
9+
tier: frontend
10+
ports:
11+
- protocol: "TCP"
12+
port: 80
13+
targetPort: 80
14+
type: LoadBalancer
15+
...
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: hello-world
5+
spec:
6+
selector:
7+
matchLabels:
8+
run: load-balancer-example
9+
replicas: 2
10+
template:
11+
metadata:
12+
labels:
13+
run: load-balancer-example
14+
spec:
15+
containers:
16+
- name: hello-world
17+
image: gcr.io/google-samples/node-hello:1.0
18+
ports:
19+
- containerPort: 8080
20+
protocol: TCP

0 commit comments

Comments
 (0)