diff --git a/helm/sealed-secrets/README.md b/helm/sealed-secrets/README.md index 5a9e785d32..58c66502d6 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/templates/pdb.yaml b/helm/sealed-secrets/templates/pdb.yaml new file mode 100644 index 0000000000..133883b435 --- /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 3d41b862a0..e0dbdf18d5 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: 1 + ## @param pdb.maxUnavailable The maximum number of unavailable pods (non number to omit) + ## + maxUnavailable: ""