Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add pdb #1340

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions helm/sealed-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
20 changes: 20 additions & 0 deletions helm/sealed-secrets/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
13 changes: 13 additions & 0 deletions helm/sealed-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""