Skip to content
New issue

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

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

Already on GitHub? # to your account

feat: Pod disruption budget #324

Merged
merged 1 commit into from
Jan 18, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/charts/vault-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The following table lists the configurable parameters of the Helm chart.
| Parameter | Type | Default | Description |
| --- | ---- | ------- | ----------- |
| `replicaCount` | int | `1` | Number of replicas (pods) to launch. |
| `pdb.create` | bool | `true` | Create pod disruption budget if replicaCount > 1. |
| `pdb.minAvailable` | int | `1` | Min available for PDB. |
| `image.repository` | string | `"ghcr.io/bank-vaults/vault-operator"` | Name of the image repository to pull the container image from. |
| `image.pullPolicy` | string | `"IfNotPresent"` | [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) for updating already existing images on a node. |
| `image.tag` | string | `""` | Image tag override for the default value (chart appVersion). |
Expand Down
24 changes: 24 additions & 0 deletions deploy/charts/vault-operator/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if and .Values.pdb.create (gt (int .Values.replicaCount) 1) }}
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "vault-operator.fullname" . }}
labels:
helm.sh/chart: {{ include "vault-operator.chart" . }}
app.kubernetes.io/name: {{ include "vault-operator.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- end }}
{{- if .Values.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "vault-operator.name" . }}
{{- end }}
8 changes: 8 additions & 0 deletions deploy/charts/vault-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
# -- Number of replicas (pods) to launch.
replicaCount: 1

pdb:
# -- Create pod disruption budget if replicaCount > 1.
create: true
# -- Min available for PDB.
minAvailable: 1
# -- Max unavailable for PDB.
# maxUnavailable: 1

image:
# -- Name of the image repository to pull the container image from.
repository: ghcr.io/bank-vaults/vault-operator
Expand Down
Loading