forked from stepanstipl/k8s-demo-app
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployment.yaml
50 lines (50 loc) · 1 KB
/
deployment.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
47
48
49
50
apiVersion: apps/v1
kind: Deployment
metadata:
name: k8-demo
spec:
selector:
matchLabels:
app: k8-demo
replicas: 3
template:
metadata:
labels:
app: k8-demo
spec:
containers:
- name: k8s-demo-app
image: nbrand/k8s-demo-app:0.1
# image: nbrand/k8s-demo-app:ab885ed-dirty
imagePullPolicy: Always
env:
- name: K8S_DEMO_APP_MESSAGE
value: "Hello Kubernetes on AWS!"
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
livenessProbe:
httpGet:
path: /healthz
port: http
ports:
- name: http
containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: k8demo-service
spec:
type: LoadBalancer
selector:
app: k8-demo
ports:
- protocol: TCP
port: 80
targetPort: 8080