From 65cbc8a474b5bb1eb16819f2b07d58ca73615af1 Mon Sep 17 00:00:00 2001 From: Micah Huber Date: Fri, 5 May 2023 13:22:28 -0500 Subject: [PATCH] add support for specifying pod labels and annotations to add to pods in helm chart Signed-off-by: Micah Huber --- helm/snapscheduler/Chart.yaml | 4 ++-- helm/snapscheduler/README.md | 4 ++++ helm/snapscheduler/templates/deployment.yaml | 7 +++++++ helm/snapscheduler/values.yaml | 6 ++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/helm/snapscheduler/Chart.yaml b/helm/snapscheduler/Chart.yaml index 5a6a1d86..ceedfe74 100644 --- a/helm/snapscheduler/Chart.yaml +++ b/helm/snapscheduler/Chart.yaml @@ -2,9 +2,9 @@ apiVersion: v2 name: snapscheduler # Chart version: Incremented during chart, template, or appVersion changes. -version: "3.2.0" +version: "3.3.0" description: >- - An operator to take scheduled snapshots of Kubernetes persistent volumes + An operator to take scheduled snapshots of Kubernetes persistent volumes type: application # Adding "-0" at the end of the version string permits pre-release kube versions # to match. See https://github.com/helm/helm/issues/6190 diff --git a/helm/snapscheduler/README.md b/helm/snapscheduler/README.md index 891ecd8c..e98439b3 100644 --- a/helm/snapscheduler/README.md +++ b/helm/snapscheduler/README.md @@ -188,3 +188,7 @@ case, the defaults, shown below, should be sufficient. topology domain(s) that each Node is in. - `affinity`: node-level anti-affinity - Allows setting the operator pod's affinity +- `podLabels`: `{}` + - map of additional labels to add to pods +- `podAnnotations`: `{}` + - map of additional annotations to add to pods diff --git a/helm/snapscheduler/templates/deployment.yaml b/helm/snapscheduler/templates/deployment.yaml index 594ed48b..0355309d 100644 --- a/helm/snapscheduler/templates/deployment.yaml +++ b/helm/snapscheduler/templates/deployment.yaml @@ -14,6 +14,13 @@ spec: labels: backube/snapscheduler-affinity: manager {{- include "snapscheduler.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/helm/snapscheduler/values.yaml b/helm/snapscheduler/values.yaml index 519321c8..de0efadc 100644 --- a/helm/snapscheduler/values.yaml +++ b/helm/snapscheduler/values.yaml @@ -36,6 +36,12 @@ podSecurityContext: # seccompProfile: # type: RuntimeDefault +# additional annotations to add to pods +podAnnotations: {} + +# additional labels to add to pods +podLabels: {} + securityContext: allowPrivilegeEscalation: false capabilities: