Skip to content

Commit a7b812e

Browse files
authored
feat: Pod disruption budget (#324)
Signed-off-by: camaeel <[email protected]>
1 parent f3517c8 commit a7b812e

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

deploy/charts/vault-operator/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ The following table lists the configurable parameters of the Helm chart.
1717
| Parameter | Type | Default | Description |
1818
| --- | ---- | ------- | ----------- |
1919
| `replicaCount` | int | `1` | Number of replicas (pods) to launch. |
20+
| `pdb.create` | bool | `true` | Create pod disruption budget if replicaCount > 1. |
21+
| `pdb.minAvailable` | int | `1` | Min available for PDB. |
2022
| `image.repository` | string | `"ghcr.io/bank-vaults/vault-operator"` | Name of the image repository to pull the container image from. |
2123
| `image.pullPolicy` | string | `"IfNotPresent"` | [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) for updating already existing images on a node. |
2224
| `image.tag` | string | `""` | Image tag override for the default value (chart appVersion). |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{- if and .Values.pdb.create (gt (int .Values.replicaCount) 1) }}
2+
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "vault-operator.fullname" . }}
6+
labels:
7+
helm.sh/chart: {{ include "vault-operator.chart" . }}
8+
app.kubernetes.io/name: {{ include "vault-operator.name" . }}
9+
app.kubernetes.io/instance: {{ .Release.Name }}
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
11+
{{- with .Values.labels }}
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- if .Values.pdb.minAvailable }}
16+
minAvailable: {{ .Values.pdb.minAvailable }}
17+
{{- end }}
18+
{{- if .Values.pdb.maxUnavailable }}
19+
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
20+
{{- end }}
21+
selector:
22+
matchLabels:
23+
app.kubernetes.io/name: {{ include "vault-operator.name" . }}
24+
{{- end }}

deploy/charts/vault-operator/values.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
# -- Number of replicas (pods) to launch.
66
replicaCount: 1
77

8+
pdb:
9+
# -- Create pod disruption budget if replicaCount > 1.
10+
create: true
11+
# -- Min available for PDB.
12+
minAvailable: 1
13+
# -- Max unavailable for PDB.
14+
# maxUnavailable: 1
15+
816
image:
917
# -- Name of the image repository to pull the container image from.
1018
repository: ghcr.io/bank-vaults/vault-operator

0 commit comments

Comments
 (0)