helmfile.yaml
3.71 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
environments:
default:
values:
- namespace: postgresql
namePrefix: "test-"
restoreFromEmpty:
enabled: true
postgresqlServer:
jsonPatches: []
strategicMergePatches: []
postgresPassword: CHANGEME
password: CHANGEME
database: CHANGEME
user: CHANGEME
images:
debian: "debian:bullseye-20211220"
postgresql: "bitnami/postgresql:14.1.0-debian-10-r66"
releases:
- name: {{ .Values.namePrefix }}postgresql-restore-from-empty
namespace: {{ .Values.namespace }}
chart: charts/restore-from-empty
condition: restoreFromEmpty.enabled
values:
- set-common-values.yaml.gotmpl
strategicMergePatches:
- apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Values.namePrefix }}postgresql-restore-from-empty
namespace: {{ .Values.namespace }}
spec:
template:
spec:
volumes:
- name: postgresql-entrypoint-initdb
persistentVolumeClaim:
claimName: {{ .Values.namePrefix }}postgresql-entrypoint-initdb
- name: postgresql-scripts
configMap:
name: {{ .Values.namePrefix }}postgresql-scripts
- name: {{ .Values.namePrefix }}postgresql-server
namespace: {{ .Values.namespace }}
chart: .
values:
- set-common-values.yaml.gotmpl
jsonPatches:
{{- if not (empty (.Values.postgresqlServer.jsonPatches)) }}
{{- .Values.postgresqlServer.jsonPatches | toYaml | indent 6 }}
{{- end }}
strategicMergePatches:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.namePrefix }}postgresql-server
namespace: {{ .Values.namespace }}
spec:
selector:
matchLabels:
app: {{ .Values.namePrefix }}postgresql-server
template:
metadata:
labels:
app: {{ .Values.namePrefix }}postgresql-server
spec:
volumes:
- name: postgresql-data
persistentVolumeClaim:
claimName: {{ .Values.namePrefix }}postgresql-data
- name: postgresql-config
configMap:
name: {{ .Values.namePrefix }}postgresql-config
- name: postgresql-scripts
configMap:
name: {{ .Values.namePrefix }}postgresql-scripts
- name: postgresql-secret
secret:
secretName: {{ .Values.namePrefix }}postgresql-secret
- apiVersion: v1
kind: Service
metadata:
name: {{ .Values.namePrefix }}postgresql
namespace: {{ .Values.namespace }}
spec:
selector:
app: {{ .Values.namePrefix }}postgresql-server
- apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.namePrefix }}postgresql-config
namespace: {{ .Values.namespace }}
data:
POSTGRESQL_DATABASE: {{ .Values.postgresqlServer.database }}
POSTGRESQL_USER: {{ .Values.postgresqlServer.user }}
- apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.namePrefix }}postgresql-secret
namespace: {{ .Values.namespace }}
stringData:
POSTGRESQL_PASSWORD: {{ .Values.postgresqlServer.password }}
POSTGRESQL_POSTGRES_PASSWORD: {{ .Values.postgresqlServer.postgresPassword }}
{{- if not (empty (.Values.postgresqlServer.strategicMergePatches)) }}
{{- .Values.postgresqlServer.strategicMergePatches | toYaml | indent 6 }}
{{- end }}