-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathreana-db.yaml
78 lines (78 loc) · 2.17 KB
/
reana-db.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{{- if .Values.components.reana_db.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "reana.prefix" . }}-db
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
selector:
app: {{ include "reana.prefix" . }}-db
ports:
- port: 5432
targetPort: 5432
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "reana.prefix" . }}-db
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ if .Values.maintenance.enabled -}} 0 {{- else -}} 1 {{- end }}
selector:
matchLabels:
app: {{ include "reana.prefix" . }}-db
template:
metadata:
labels:
app: {{ include "reana.prefix" . }}-db
spec:
containers:
- name: db
image: docker.io/library/postgres:12.13
args:
- -c
- max_connections=300
ports:
- containerPort: 5432
env:
- name: TZ
value: "Europe/Zurich"
- name: POSTGRES_DB
value: reana
{{- if not .Values.debug.enabled }}
- name: POSTGRES_USER
value: reana
- name: POSTGRES_PASSWORD
value: reana
{{- else }}
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: {{ include "reana.prefix" . }}-db-secrets
key: user
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "reana.prefix" . }}-db-secrets
key: password
{{- end }}
volumeMounts:
- mountPath: /var/lib/postgresql/data
subPath: db
name: reana-infrastructure-volume
volumes:
- name: reana-infrastructure-volume
{{- include "reana.infrastructure_volume" . | nindent 10 }}
{{- if .Values.node_label_infrastructuredb }}
{{- $full_label := split "=" .Values.node_label_infrastructuredb }}
nodeSelector:
{{ $full_label._0 }}: {{ $full_label._1 }}
{{- else if .Values.node_label_infrastructure }}
{{- $full_label := split "=" .Values.node_label_infrastructure }}
nodeSelector:
{{ $full_label._0 }}: {{ $full_label._1 }}
{{- end }}
{{- end }}