-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathdeployment-pgsql.yaml
More file actions
75 lines (75 loc) · 2.56 KB
/
deployment-pgsql.yaml
File metadata and controls
75 lines (75 loc) · 2.56 KB
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
{{- if .Values.server }}
{{- if and .Values.server.broadcastPgsql (not .Values.server.broadcastUri) }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "opal.pgsqlName" . }}
labels:
{{- include "opal.pgsqlLabels" . | nindent 4 }}
spec:
replicas: {{ .Values.broadcastReplicas }}
selector:
matchLabels:
{{- include "opal.pgsqlSelectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "opal.pgsqlLabels" . | nindent 8 }}
spec:
{{- with .Values.image.client.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.openshift.enabled .Values.postgresql.securityContext }}
securityContext:
{{- if .Values.postgresql.securityContext }}
{{- toYaml .Values.postgresql.securityContext | nindent 8 }}
{{- else if .Values.openshift.enabled }}
{{- toYaml .Values.openshift.securityContext | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.openshift.enabled }}
volumes:
- name: postgres-data
emptyDir: {}
{{- end }}
containers:
- name: pgsql
image: {{ include "opal.pgsqlImage" . | quote }}
imagePullPolicy: IfNotPresent
{{- if or .Values.openshift.enabled .Values.postgresql.containerSecurityContext }}
securityContext:
{{- if .Values.postgresql.containerSecurityContext }}
{{- toYaml .Values.postgresql.containerSecurityContext | nindent 12 }}
{{- else if .Values.openshift.enabled }}
{{- toYaml .Values.openshift.containerSecurityContext | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.openshift.enabled }}
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: postgres-data
{{- end }}
ports:
- name: pgsql
containerPort: 5432
protocol: TCP
env:
- name: POSTGRES_DB
value: postgres
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
value: postgres
{{- if .Values.openshift.enabled }}
- name: PGDATA
value: "/var/lib/postgresql/data/pgdata"
{{- end }}
{{- if .Values.postgresql.extraEnv }}
{{- range $name, $value := .Values.postgresql.extraEnv }}
- name: {{ $name }}
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}