From 476aee858ebd9b32177cf7ceae637d270d03550e Mon Sep 17 00:00:00 2001 From: Starlight Romero Date: Thu, 25 May 2023 09:22:00 -0700 Subject: [PATCH] feat(pdb): add optional podDisruptionBudget to deployment --- .../templates/poddisruptionbudget.yaml | 19 +++++++++++++++++++ helm/trident-operator/values.yaml | 3 +++ 2 files changed, 22 insertions(+) create mode 100644 helm/trident-operator/templates/poddisruptionbudget.yaml diff --git a/helm/trident-operator/templates/poddisruptionbudget.yaml b/helm/trident-operator/templates/poddisruptionbudget.yaml new file mode 100644 index 000000000..484a7cdee --- /dev/null +++ b/helm/trident-operator/templates/poddisruptionbudget.yaml @@ -0,0 +1,19 @@ +{{- if .Values.podDisruptionBudget }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: +{{- if .Values.deploymentAnnotations }} + annotations: +{{ toYaml .Values.deploymentAnnotations | indent 4 }} +{{- end }} + labels: + app: operator.trident.netapp.io + name: trident-operator + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: operator.trident.netapp.io + name: trident-operator +{{ toYaml .Values.podDisruptionBudget | indent 2 }} +{{- end }} \ No newline at end of file diff --git a/helm/trident-operator/values.yaml b/helm/trident-operator/values.yaml index 92aec2788..82f61c1a7 100644 --- a/helm/trident-operator/values.yaml +++ b/helm/trident-operator/values.yaml @@ -19,6 +19,9 @@ tolerations: [] ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity affinity: {} +## PodDisruptionBudget for pods +podDisruptionBudget: {} + # tridentControllerPluginNodeSelector additional nodeSelectors for the Pod running the Trident Controller CSI Plugin. # tridentControllerPluginNodeSelector : {}