12345678910111213141516171819202122232425262728293031323334353637383940 |
- {{- if .Values.logsearchapi.enabled -}}
- {{- if .Values.ixChartContext.isUpgrade -}}
- {{ $values := (. | mustDeepCopy) }}
- {{ $_ := set $values "common" (dict "nameSuffix" (include "postgres.nameSuffix" .)) }}
- apiVersion: batch/v1
- kind: Job
- metadata:
- name: pre-upgrade-hook
- annotations:
- "helm.sh/hook": pre-upgrade
- "helm.sh/hook-weight": "1"
- "helm.sh/hook-delete-policy": hook-succeeded
- rollme: {{ randAlphaNum 5 | quote }}
- spec:
- template:
- metadata:
- name: pre-upgrade-hook
- spec:
- restartPolicy: Never
- containers:
- - name: {{ .Chart.Name }}-postgres-backup
- image: {{ include "postgres.imageName" . }}
- imagePullPolicy: {{ .Values.image.pullPolicy }}
- env: {{ include "postgresBackup.envVariableConfiguration" $values | nindent 10 }}
- - name: BACKUP_NAME
- value: {{ include "postgres.backupName" . }}
- volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }}
- - name: backup-script-configmap
- mountPath: /bin/backup_entrypoint.sh
- readOnly: true
- subPath: entrypoint.sh
- command:
- - /bin/backup_entrypoint.sh
- volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }}
- - name: backup-script-configmap
- configMap:
- defaultMode: 0700
- name: postgres-backup-hook-config-map
- {{- end -}}
- {{- end -}}
|