-
Notifications
You must be signed in to change notification settings - Fork 0
/
spec.yaml
46 lines (44 loc) · 1 KB
/
spec.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world-go
labels:
app: go
spec:
replicas: 3
selector:
matchLabels:
app: go
template:
metadata:
labels:
app: go
spec:
containers:
- name: go
image: <IMAGE>
ports:
- containerPort: 8080
---
kind: Service
apiVersion: v1
metadata:
name: hello-world-go-svc
spec:
# Expose the service on a static port on each node
# so that we can access the service from outside the cluster
type: NodePort
# When the node receives a request on the static port (30163)
# "select pods with the label 'app' set to 'echo-hostname'"
# and forward the request to one of them
selector:
app: go
ports:
# Three types of ports for a service
# nodePort - a static port assigned on each the node
# port - port exposed internally in the cluster
# targetPort - the container port to send requests to
- nodePort: 30800
port: 8080
targetPort: 8080
---