From feb705404ecabe73159bc1b8fdc8bf7ea1575980 Mon Sep 17 00:00:00 2001 From: Paulo Sousa Date: Tue, 9 Jul 2024 10:48:10 -0300 Subject: [PATCH] nginx-operator: add pdb entry --- .../templates/poddirruptionbudget.yaml | 13 +++++++++++++ charts/nginx-operator/values.yaml | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 charts/nginx-operator/templates/poddirruptionbudget.yaml diff --git a/charts/nginx-operator/templates/poddirruptionbudget.yaml b/charts/nginx-operator/templates/poddirruptionbudget.yaml new file mode 100644 index 0000000..3e0e684 --- /dev/null +++ b/charts/nginx-operator/templates/poddirruptionbudget.yaml @@ -0,0 +1,13 @@ +{{- if and .Values.podDisruptionBudget.enabled (gt (.Values.replicaCount|int) 1) }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "nginx-operator.fullname" . }} + labels: + {{- include "nginx-operator.labels" . | nindent 4 }} +spec: + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} + selector: + matchLabels: + {{- include "nginx-operator.selectorLabels" . | nindent 6 }} +{{- end }} diff --git a/charts/nginx-operator/values.yaml b/charts/nginx-operator/values.yaml index 8fa9a4c..0bbf6e0 100644 --- a/charts/nginx-operator/values.yaml +++ b/charts/nginx-operator/values.yaml @@ -38,6 +38,10 @@ podAnnotations: {} podSecurityContext: {} # fsGroup: 2000 +podDisruptionBudget: + enabled: true + maxUnavailable: "10%" + securityContext: {} # capabilities: # drop: