Skip to content

Commit

Permalink
Adding cleanup.enabled and cleanup.imagePullSecrets
Browse files Browse the repository at this point in the history
  • Loading branch information
e committed May 8, 2024
1 parent 2ddb6ee commit dd8a143
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/k8up/templates/cleanup-hook.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.cleanup.enabled -}}

apiVersion: v1
kind: ServiceAccount
metadata:
Expand Down Expand Up @@ -79,6 +81,10 @@ spec:
labels:
{{- include "k8up.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.cleanup.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
restartPolicy: Never
serviceAccountName: cleanup-service-account
containers:
Expand All @@ -99,3 +105,5 @@ spec:
kubectl -n "$ns" delete rolebinding pod-executor-namespaced --ignore-not-found=true
kubectl -n "$ns" delete role pod-executor --ignore-not-found=true
done
{{- end -}}
4 changes: 4 additions & 0 deletions charts/k8up/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ resources:
memory: 128Mi

cleanup:
# -- Whether to enable cleanup of leftover rolebindings and roles from older k8up versions
enabled: false
# -- Cleanup-job image pull policy
pullPolicy: IfNotPresent
# -- Cleanup-job image registry
Expand All @@ -149,3 +151,5 @@ cleanup:
repository: bitnami/kubectl
# -- Cleanup-job image tag (version)
tag: latest
# -- Cleanup-job Image pull secrets to use
imagePullSecrets: []

0 comments on commit dd8a143

Please sign in to comment.