Skip to content

Commit

Permalink
Use kubectl to delete all configurations in helm hook
Browse files Browse the repository at this point in the history
Signed-off-by: Kate Goldenring <[email protected]>
  • Loading branch information
kate-goldenring committed Nov 8, 2024
1 parent b30e14e commit 80f84fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions deployment/helm/templates/pre-delete-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ spec:
serviceAccountName: akri-helm-cleanup-hook-sa
containers:
- name: delete-configurations
image: curlimages/curl:latest
image: bitnami/kubectl:latest
command: ["/bin/sh", "-c"]
args: [
"curl -ik -X DELETE -H \"Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)\" https://kubernetes.default.svc.cluster.local/apis/akri.sh/v0/namespaces/{{ .Release.Namespace }}/configurations"
"kubectl delete configurations.akri.sh --all --all-namespaces --wait"
]
{{- end }}
4 changes: 2 additions & 2 deletions deployment/helm/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ metadata:
labels:
app.kubernetes.io/component: helm-hook
rules:
- apiGroups: ["akri.sh"]
- apiGroups: [{{ .Values.crds.group | quote }}]
resources: ["configurations"]
verbs: ["deletecollection"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete", "deletecollection"]
---
apiVersion: 'rbac.authorization.k8s.io/v1'
kind: 'ClusterRoleBinding'
Expand Down

0 comments on commit 80f84fc

Please sign in to comment.