Add upgrade hook where we nuke nextcloud/postgres deployments

This commit is contained in:
Waqar Ahmed 2020-12-11 20:45:40 +05:00
parent 0283799700
commit dbde74851d
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
apiVersion: batch/v1
kind: Job
metadata:
name: "pre-upgrade-hook1"
annotations:
"helm.sh/hook": pre-upgrade
"helm.sh/hook-weight": "-1"
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
metadata:
name: "pre-upgrade-hook1"
spec:
restartPolicy: Never
serviceAccountName: {{ template "nextcloud.serviceAccountName" }}
containers:
- name: kubectl
image: "bitnami/kubectl:1.19"
command: ["delete" , "deployment", "{{ template "nextcloud.fullname" . }}", "{{ template "nextcloud.fullname" . }}-postgres"]