From ccb9e89df2b62d37df8dbcc6c6a4fef5d295bfca Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Thu, 5 Oct 2023 08:42:31 -0400 Subject: [PATCH 1/2] fix: add pdb Fixes #1321 Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- helm/sealed-secrets/templates/pdb.yaml | 20 ++++++++++++++++++++ helm/sealed-secrets/values.yaml | 13 +++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 helm/sealed-secrets/templates/pdb.yaml diff --git a/helm/sealed-secrets/templates/pdb.yaml b/helm/sealed-secrets/templates/pdb.yaml new file mode 100644 index 000000000..133883b43 --- /dev/null +++ b/helm/sealed-secrets/templates/pdb.yaml @@ -0,0 +1,20 @@ +{{- if .Values.pdb.create }} +kind: PodDisruptionBudget +apiVersion: policy/v1 +metadata: + name: {{ include "sealed-secrets.fullname" . }} + namespace: {{ include "sealed-secrets.namespace" . }} + labels: {{- include "sealed-secrets.labels" . | nindent 4 }} + {{- if .Values.commonAnnotations }} + annotations: {{- toYaml .Values.commonAnnotations | nindent 4 }} + {{- end }} +spec: + {{- if regexMatch "64$" (typeOf .Values.pdb.minAvailable) }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if regexMatch "64$" (typeOf .Values.pdb.maxUnavailable) }} + maxUnavailable: {{ .Values.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: {{- include "sealed-secrets.matchLabels" . | nindent 6 }} +{{- end }} diff --git a/helm/sealed-secrets/values.yaml b/helm/sealed-secrets/values.yaml index 3d41b862a..ebba6d12f 100644 --- a/helm/sealed-secrets/values.yaml +++ b/helm/sealed-secrets/values.yaml @@ -447,3 +447,16 @@ metrics: ## @param metrics.dashboards.namespace Namespace where Grafana dashboard ConfigMap is deployed ## namespace: "" + +## @section PodDisruptionBudget Parameters + +pdb: + ## @param pdb.create Specifies whether a PodDisruptionBudget should be created + ## + create: false + ## @param pdb.minAvailable The minimum number of pods (non number to omit) + ## + minAvailable: 0 + ## @param pdb.maxUnavailable The maximum number of unavailable pods (non number to omit) + ## + maxUnavailable: From 78380786755b5c043cba648ab8559a76f5dfe8f3 Mon Sep 17 00:00:00 2001 From: Alvaro Neira Ayuso Date: Thu, 26 Oct 2023 13:05:59 +0200 Subject: [PATCH 2/2] Add Readme and fix values Signed-off-by: Alvaro Neira Ayuso --- helm/sealed-secrets/README.md | 8 ++++++++ helm/sealed-secrets/values.yaml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/helm/sealed-secrets/README.md b/helm/sealed-secrets/README.md index 5a9e785d3..58c66502d 100644 --- a/helm/sealed-secrets/README.md +++ b/helm/sealed-secrets/README.md @@ -204,6 +204,14 @@ The command removes all the Kubernetes components associated with the chart and | `metrics.dashboards.annotations` | Annotations to be added to the Grafana dashboard ConfigMap | `{}` | | `metrics.dashboards.namespace` | Namespace where Grafana dashboard ConfigMap is deployed | `""` | +### PodDisruptionBudget Parameters + +| Name | Description | Value | +| -------------------- | ----------------------------------------------------------- | ------- | +| `pdb.create` | Specifies whether a PodDisruptionBudget should be created | `false` | +| `pdb.minAvailable` | The minimum number of pods (non number to omit) | `1` | +| `pdb.maxUnavailable` | The maximum number of unavailable pods (non number to omit) | `""` | + Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/helm/sealed-secrets/values.yaml b/helm/sealed-secrets/values.yaml index ebba6d12f..e0dbdf18d 100644 --- a/helm/sealed-secrets/values.yaml +++ b/helm/sealed-secrets/values.yaml @@ -456,7 +456,7 @@ pdb: create: false ## @param pdb.minAvailable The minimum number of pods (non number to omit) ## - minAvailable: 0 + minAvailable: 1 ## @param pdb.maxUnavailable The maximum number of unavailable pods (non number to omit) ## - maxUnavailable: + maxUnavailable: ""