Skip to content

Commit

Permalink
add unistall hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimss committed Dec 6, 2023
1 parent b4adf30 commit 5eeb8c2
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions charts/cnvrg-all-in-one/templates/hooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
####################################### Uninstall hooks #######################################
apiVersion: batch/v1
kind: Job
metadata:
name: pre-cnvrg-cleanup
namespace: {{ .Release.Namespace}}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-weight": "2"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
serviceAccountName: cnvrg-operator
containers:
- name: delete-cnvrgapp
image: "{{ .Values.imageHub }}/cnvrg-tools:v0.3"
args:
- /bin/bash
- -c
- |
set -x
echo "running cleanup"
kubectl delete cnvrgapp cnvrg-app -n {{ .Release.Namespace }} --ignore-not-found
while (( $(kubectl get cnvrgapp cnvrg-app -n {{ .Release.Namespace }} --ignore-not-found | grep cnvrg-app | wc -l ) != 0 )); do
echo "waiting for cnvrgapp will be deleted. . . ";
sleep 1
done
restartPolicy: Never
backoffLimit: 4

0 comments on commit 5eeb8c2

Please sign in to comment.