-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yaml
38 lines (37 loc) · 891 Bytes
/
deploy.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
---
# Run built node app hello-kube with 3 replica
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-kube-deployment
labels:
app: hello-kube
spec:
replicas: 3 # 3 replica of this 'pod'
selector:
matchLabels: # node selection rule: if label name == 'simple-kube', then 'choose' it
app: hello-kube
template:
metadata:
labels:
app: hello-kube
spec:
containers:
- name: hello-kube
image: hello-kube:latest # image is in local
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000 # port 'inside' container
---
apiVersion: v1
kind: Service
metadata:
name: hello-kube-service
spec:
type: ClusterIP
selector:
app: hello-kube
ports:
- protocol: TCP
port: 80 # port that is 'exposed', choose 80 to see differeneces
targetPort: 8000 # port that is targeted to (Pod's port)