helmfile.yaml
2.59 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
{{- $dummy := merge (readFile "./defaults.yaml" | fromYaml) .Values }}
---
repositories:
- name: bitnami
url: https://charts.bitnami.com/bitnami
- name: postgresql-rclone
url: git+https://gitlab.brainfood.com/brainfood/k8s-postgresql.git@charts/postgresql-rclone?ref=master
releases:
- name: {{ .Values.chart.namePrefix }}postgresql
namespace: {{ .Values.chart.namespace }}
chart: bitnami/postgresql
version: {{ .Values | get "chart.version" "12.8.0" }}
dependencies:
- chart: postgresql-rclone/postgresql-rclone
alias: postgresql-rclone
version: 0.0.0
values:
# Overlay passed in values
- {{ omit .Values "rclone" "backup" "restore" "local" "postgresql-rclone" | toYaml | nindent 8 }}
# Merge array-based things
- primary:
extraVolumeMounts:
{{- range (.Values | get "primary.extraVolumeMounts" list) }}
- {{ . | toYaml | indent 14 }}
{{- end }}
- name: rclone-restores
mountPath: /docker-entrypoint-initdb.d
extraVolumes:
{{- range (.Values | get "primary.extraVolumes" list) }}
- {{ . | toYaml | nindent 14 }}
{{- end }}
- name: rclone-restores
persistentVolumeClaim:
claimName: {{ .Values.chart.namePrefix }}postgresql-rclone-restores
initContainers:
- name: wait-for-restore-ready
image: bash:latest
volumeMounts:
- name: rclone-restores
mountPath: /docker-entrypoint-initdb.d
command:
- bash
- -cx
- |-
until [ -f /docker-entrypoint-initdb.d/.restored ]; do
sleep 5
done
if [ -f /docker-entrypoint-initdb.d/.error ]; then exit 1; fi
{{- range (.Values | get "primary.initContainers" list) }}
- {{ . | toYaml | nindent 14 }}
{{- end }}
# Configure the sub-chart
- postgresql-rclone:
nameOverride: "rclone"
postgresql:
host: {{ .Values.chart.namePrefix }}postgresql
auth:
postgresqlUser: postgres
postgresqlPassword: {{ .Values.auth.postgresPassword }}
databases:
- {{ .Values.auth.database }}
local: {{ .Values.local | toYaml | nindent 12 }}
rclone: {{ .Values.rclone | toYaml | nindent 12 }}
backup: {{ .Values.backup | toYaml | nindent 12 }}
restore: {{ .Values.restore | toYaml | nindent 12 }}