Add helmfile that combines bitnami-postgresql and postgresql-rclone.
Showing
2 changed files
with
83 additions
and
0 deletions
1 | --- | ||
2 | repositories: | ||
3 | - name: bitnami | ||
4 | url: https://charts.bitnami.com/bitnami | ||
5 | - name: postgresql-rclone | ||
6 | url: git+https://gitlab.brainfood.com/brainfood/k8s-postgresql.git@charts/postgresql-rclone?ref=master | ||
7 | |||
8 | releases: | ||
9 | - name: {{ .Values.chart.namePrefix }}postgresql | ||
10 | namespace: {{ .Values.chart.namespace }} | ||
11 | chart: bitnami/postgresql | ||
12 | dependencies: | ||
13 | - chart: postgresql-rclone/postgresql-rclone | ||
14 | alias: postgresql-rclone | ||
15 | version: 0.0.0 | ||
16 | values: | ||
17 | # Defaults | ||
18 | - ./values.yaml | ||
19 | # Overlay passed in values | ||
20 | - {{ omit .Values "rclone" "backup" "restore" "postgresql-rclone" | toYaml | nindent 8 }} | ||
21 | # Merge array-based things | ||
22 | - primary: | ||
23 | extraVolumeMounts: | ||
24 | {{- range (.Values | get "primary.extraVolumeMounts" list) }} | ||
25 | - {{ . | toYaml | indent 14 }} | ||
26 | {{- end }} | ||
27 | - name: rclone-restores | ||
28 | mountPath: /docker-entrypoint-initdb.d | ||
29 | extraVolumes: | ||
30 | {{- range (.Values | get "primary.extraVolumes" list) }} | ||
31 | - {{ . | toYaml | nindent 14 }} | ||
32 | {{- end }} | ||
33 | - name: rclone-restores | ||
34 | persistentVolumeClaim: | ||
35 | claimName: {{ .Values.chart.namePrefix }}postgresql-rclone-restores | ||
36 | initContainers: | ||
37 | - name: wait-for-restore-ready | ||
38 | image: bash:latest | ||
39 | volumeMounts: | ||
40 | - name: rclone-restores | ||
41 | mountPath: /docker-entrypoint-initdb.d | ||
42 | command: | ||
43 | - bash | ||
44 | - -cx | ||
45 | - |- | ||
46 | until [ -f /docker-entrypoint-initdb.d/.restored ]; do | ||
47 | sleep 5 | ||
48 | done | ||
49 | {{- range (.Values | get "primary.initContainers" list) }} | ||
50 | - {{ . | toYaml | nindent 14 }} | ||
51 | {{- end }} | ||
52 | # Configure the sub-chart | ||
53 | - postgresql-rclone: | ||
54 | nameOverride: "rclone" | ||
55 | postgresql: | ||
56 | host: {{ .Values.chart.namePrefix }}postgresql | ||
57 | auth: | ||
58 | postgresqlUser: postgres | ||
59 | postgresqlPassword: {{ .Values.auth.postgresPassword }} | ||
60 | databases: | ||
61 | - {{ .Values.auth.database }} | ||
62 | rclone: {{ .Values.rclone | toYaml | nindent 12 }} | ||
63 | backup: {{ .Values.backup | toYaml | nindent 12 }} | ||
64 | restore: {{ .Values.restore | toYaml | nindent 12 }} | ||
65 |
-
Please register or sign in to post a comment