From 55a42dba8ac120948d4ab598b2bcf837f51216c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kosch=C3=BCtzki?= Date: Wed, 24 Jul 2024 09:19:33 +0200 Subject: [PATCH] feat(kubernetes-etcd-backup): Allow affinity and existing claims --- charts/kubernetes-etcd-backup/Chart.yaml | 9 +++++++-- .../templates/cronjob.yaml | 7 +++++++ charts/kubernetes-etcd-backup/values.yaml | 16 ++++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/charts/kubernetes-etcd-backup/Chart.yaml b/charts/kubernetes-etcd-backup/Chart.yaml index 2ea801609..6b9b9d260 100644 --- a/charts/kubernetes-etcd-backup/Chart.yaml +++ b/charts/kubernetes-etcd-backup/Chart.yaml @@ -1,9 +1,10 @@ +--- apiVersion: v2 name: kubernetes-etcd-backup description: Chart for kubernetes-etcd-backup solution type: application -version: 1.0.4 -appVersion: v1.0.4 +version: 1.1.0 +appVersion: v1.0.6 keywords: - kubernetes-etcd-backup - kubernetes @@ -16,3 +17,7 @@ maintainers: - name: adfinis email: support@adfinis.com url: https://adfinis.com +annotations: + artifacthub.io/changes: | + - kind: changed + description: "Allow configuration of jobs affinity" diff --git a/charts/kubernetes-etcd-backup/templates/cronjob.yaml b/charts/kubernetes-etcd-backup/templates/cronjob.yaml index cf748a030..ade5f11ea 100644 --- a/charts/kubernetes-etcd-backup/templates/cronjob.yaml +++ b/charts/kubernetes-etcd-backup/templates/cronjob.yaml @@ -52,4 +52,11 @@ spec: {{- else if .Values.persistence.provisioning.enabled }} persistentVolumeClaim: claimName: {{ include "kubernetes-etcd-backup.fullname" . }} + {{- else if .Values.persistence.existingClaim }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} {{- end }} + {{ if .Values.affinity }} + affinity: + {{ .Values.affinity | toYaml | nindent 14 }} + {{ end }} diff --git a/charts/kubernetes-etcd-backup/values.yaml b/charts/kubernetes-etcd-backup/values.yaml index fc1b655a5..f034382c7 100644 --- a/charts/kubernetes-etcd-backup/values.yaml +++ b/charts/kubernetes-etcd-backup/values.yaml @@ -46,6 +46,9 @@ persistence: # -- Enable provisioned backend storage with default or configured storageClass enabled: false storageClass: "" + # -- Use an exising PVC + existingClaim: "" + image: # -- Repository image to use @@ -70,6 +73,19 @@ resources: # cpu: 100m # memory: 128Mi + +affinity: {} + # Will be added directly to the pods affinity configuration. + # nodeAffinity: + # requiredDuringSchedulingIgnoredDuringExecution: + # nodeSelectorTerms: + # - matchExpressions: + # - key: disktype + # operator: In + # values: + # - ssd + + monitoring: # -- Deploy PrometheusRule to be alerted in case of backup fails as decribed [here](https://github.com/adfinis/kubernetes-etcd-backup/blob/main/etcd-backup-cronjob-monitor.PrometheusRule.yaml). enabled: false