From dd8a143946d7e39ba0f216e631cc20be26b9c984 Mon Sep 17 00:00:00 2001 From: e Date: Tue, 7 May 2024 19:12:22 -0600 Subject: [PATCH] Adding cleanup.enabled and cleanup.imagePullSecrets --- charts/k8up/templates/cleanup-hook.yaml | 8 ++++++++ charts/k8up/values.yaml | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/charts/k8up/templates/cleanup-hook.yaml b/charts/k8up/templates/cleanup-hook.yaml index 7133feb4e..9740aed23 100644 --- a/charts/k8up/templates/cleanup-hook.yaml +++ b/charts/k8up/templates/cleanup-hook.yaml @@ -1,3 +1,5 @@ +{{- if .Values.cleanup.enabled -}} + apiVersion: v1 kind: ServiceAccount metadata: @@ -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: @@ -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 -}} diff --git a/charts/k8up/values.yaml b/charts/k8up/values.yaml index 13997cf18..f0062de2e 100644 --- a/charts/k8up/values.yaml +++ b/charts/k8up/values.yaml @@ -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 @@ -149,3 +151,5 @@ cleanup: repository: bitnami/kubectl # -- Cleanup-job image tag (version) tag: latest + # -- Cleanup-job Image pull secrets to use + imagePullSecrets: [] \ No newline at end of file