-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodolist-deployment.yaml
58 lines (58 loc) · 1.22 KB
/
todolist-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
51
52
53
54
55
56
57
58
apiVersion: apps/v1
kind: Deployment
metadata:
name: todolist-deployment
labels:
app: todolist
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 0
selector:
matchLabels:
app: todolist
template:
metadata:
labels:
app: todolist
spec:
containers:
- name: todolist
image: halimi/todo-list-service
ports:
- containerPort: 5000
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: postgres-secret
key: postgres-user
- name: DB_PASS
valueFrom:
secretKeyRef:
name: postgres-secret
key: postgres-password
- name: DB_HOST
valueFrom:
configMapKeyRef:
name: postgres-configmap
key: database_url
- name: DB_PORT
value: "5432"
---
apiVersion: v1
kind: Service
metadata:
name: todolist-service
spec:
selector:
app: todolist
type: LoadBalancer
ports:
- protocol: TCP
port: 5000
targetPort: 5000
nodePort: 30000