Skip to content

Commit

Permalink
Add helm post-delete that cleansup the CNDR /var/opt/carbonblack dirs…
Browse files Browse the repository at this point in the history
… on uninstall
  • Loading branch information
tomer-shefler committed Feb 1, 2024
1 parent f699280 commit d9b16fe
Showing 1 changed file with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- range $i, $node := (lookup "v1" "Node" "" "").items }}

apiVersion: batch/v1
kind: Job
metadata:
name: cbcontainers-edr-sensor-cleaner
annotations:
"helm.sh/hook": "post-delete"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
spec:
template:
spec:
# serviceAccountName: cbcontainers-edr-sensor-cleaner
volumes:
- hostPath:
path: /var
type: Directory
name: var-dir
containers:
- name: edr-sensor-cleaner
image: photon:4.0
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
runAsUser: 0
volumeMounts:
- mountPath: /var
name: var-dir
command: ["/usr/bin/rm", "-rf", "/var/opt/carbonblack"]
restartPolicy: Never
nodeName: "{{ $node.metadata.name }}"
---
{{- end }}

0 comments on commit d9b16fe

Please sign in to comment.