fix(postgresql): put job annotations to values
This commit is contained in:
parent
7b3e52aeb3
commit
1543b1a68f
5 changed files with 19 additions and 11 deletions
|
@ -3,7 +3,7 @@ apiVersion: "v2"
|
|||
name: "postgresql"
|
||||
description: "A Helm chart for running PostgreSQL (Postgres) database"
|
||||
type: "application"
|
||||
version: "0.1.2"
|
||||
version: "0.1.3"
|
||||
appVersion: "16.1-alpine3.18"
|
||||
|
||||
keywords:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# postgresql
|
||||
|
||||
  
|
||||
  
|
||||
|
||||
A Helm chart for running PostgreSQL (Postgres) database
|
||||
|
||||
|
@ -37,6 +37,7 @@ helm uninstall postgresql-release
|
|||
| image.repository | string | `"postgres"` | |
|
||||
| image.tag | string | `""` | |
|
||||
| imagePullSecrets | list | `[]` | |
|
||||
| job.annotations | object | `{"helm.sh/hook":"post-install,post-upgrade","helm.sh/hook-delete-policy":"before-hook-creation,hook-succeeded"}` | Annotations (usefull to delete job by helm afterwards) |
|
||||
| job.databases | object | `{}` | Bootstrap databases into postgresql server. When databases already exists, they will stay untouched. databases: "name_of_database": owner: "existing_user_which_will_get_grant" additionalParams: "" # Optional |
|
||||
| job.enabled | bool | `true` | Enable database bootstrapping. |
|
||||
| job.retries | int | `60` | Amount of retries while waiting for postgresql server is available. |
|
||||
|
|
|
@ -6,15 +6,18 @@ metadata:
|
|||
name: "{{ include "postgresql.fullname" . }}-bootstrap"
|
||||
labels:
|
||||
{{- include "postgresql.labels" . | nindent 4 }}
|
||||
{{- with .Values.job.annotations }}
|
||||
annotations:
|
||||
"helm.sh/hook": "post-install,post-upgrade"
|
||||
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
backoffLimit: 4
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
confighash-users: {{ toYaml .Values.job.users | sha256sum | trunc 32 }}
|
||||
confighash-databases: {{ toYaml .Values.job.databases | sha256sum | trunc 32 }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
|
@ -68,7 +71,7 @@ spec:
|
|||
volumes:
|
||||
- name: "bootstrap"
|
||||
secret:
|
||||
secretName: {{ include "postgresql.fullname" . }}-job
|
||||
secretName: {{ include "postgresql.fullname" . }}-bootstrap
|
||||
defaultMode: 0550
|
||||
{{- end }}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
apiVersion: "v1"
|
||||
kind: "Secret"
|
||||
metadata:
|
||||
name: {{ include "postgresql.fullname" . }}-job
|
||||
name: {{ include "postgresql.fullname" . }}-bootstrap
|
||||
labels:
|
||||
{{- include "postgresql.labels" . | nindent 4 }}
|
||||
stringData:
|
|
@ -99,6 +99,10 @@ job:
|
|||
retries: 60
|
||||
# -- Time to wait in each wait in each iteration until postgresql server is available.
|
||||
wait: 5
|
||||
# -- Annotations (usefull to delete job by helm afterwards)
|
||||
annotations:
|
||||
"helm.sh/hook": "post-install,post-upgrade"
|
||||
"helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
|
||||
# -- Bootstrap users into postgresql server. When users already exists, they will stay untouched.
|
||||
#
|
||||
# users:
|
||||
|
|
Loading…
Add table
Reference in a new issue