-
Notifications
You must be signed in to change notification settings - Fork 5
/
db-deployment.yaml
57 lines (57 loc) · 1.51 KB
/
db-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
{{ if .Values.db.deploy_db }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: workers-db
namespace: {{ .Values.workers_namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: workers-db
template:
metadata:
labels:
app: workers-db
spec:
containers:
- name: workers-db
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: workers-db-secret
key: USER
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: workers-db-secret
key: PASSWORD
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: workers-db-secret
key: NAME
image: postgres:12.4
ports:
- containerPort: 5432
resources:
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
{{- range $name, $value := .Values.db.volumeMounts }}
- name: {{ $value.name }}
mountPath: {{ quote $value.mountPath }}
subPath: {{ quote $value.subPath }}
{{- end }}
volumes:
{{- range $name, $value := .Values.db.volumes }}
- name: {{ $value.name }}
hostPath:
path: {{ $value.hostPath.path }}
type: {{ $value.hostPath.type }}
{{- end}}
nodeSelector:
component: api
{{ end }}