-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment.yml
93 lines (93 loc) · 2.26 KB
/
deployment.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: road-review-deployment
namespace: road-review-namespace
labels:
app: road-review-backend
spec:
replicas: 1
selector:
matchLabels:
app: road-review-backend
template:
metadata:
labels:
app: road-review-backend
spec:
containers:
- name: road-review-backend
image: road-review-backend:$VERSION_NUM
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3000
resources:
limits:
cpu: 1
memory: "1Gi"
requests:
cpu: 0.5
memory: "500Mi"
envFrom:
- configMapRef:
name: road-review-configmap
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-pass
key: password
- name: REDIS_HOST
valueFrom:
secretKeyRef:
name: redis-host
key: host
- name: REDIS_PORT
valueFrom:
secretKeyRef:
name: redis-host
key: port
- name: REDIS_DB_ID
valueFrom:
secretKeyRef:
name: redis-host
key: db-id
- name: DB_USER
valueFrom:
secretKeyRef:
name: mysql
key: mysql-user-name
- name: DB_HOST
valueFrom:
secretKeyRef:
name: mysql
key: mysql-host
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: mysql-password
- name: DB_NAME
valueFrom:
secretKeyRef:
name: mysql
key: mysql-db-name
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: road-review-backend
labels:
app: road-review-backend
spec:
type: NodePort
selector:
app: road-review-backend
ports:
- name: http
port: 3000
targetPort: 3000
protocol: TCP