diff --git a/chart/k8s-pause/Chart.yaml b/chart/k8s-pause/Chart.yaml index be8419b..c2b76f1 100644 --- a/chart/k8s-pause/Chart.yaml +++ b/chart/k8s-pause/Chart.yaml @@ -14,4 +14,4 @@ keywords: name: k8s-pause sources: - https://github.com/DoodleScheduling/k8s-pause -version: 0.2.7 +version: 0.2.8 diff --git a/chart/k8s-pause/templates/pdb.yaml b/chart/k8s-pause/templates/pdb.yaml new file mode 100644 index 0000000..590da64 --- /dev/null +++ b/chart/k8s-pause/templates/pdb.yaml @@ -0,0 +1,22 @@ +{{- if .Values.pdb.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "k8s-pause.fullname" . }}-pdb + labels: + app.kubernetes.io/name: {{ include "k8s-pause.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + helm.sh/chart: {{ include "k8s-pause.chart" . }} +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 "k8s-pause.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/chart/k8s-pause/values.yaml b/chart/k8s-pause/values.yaml index 680fbf6..6ea4ea8 100644 --- a/chart/k8s-pause/values.yaml +++ b/chart/k8s-pause/values.yaml @@ -91,6 +91,12 @@ envFromSecret: "" ## key: password extraEnvSecrets: {} +# Ability to set a PodDisruptionBudget +pdb: + enabled: false + minAvailable: 1 + maxUnavailable: "" + securityContext: allowPrivilegeEscalation: false capabilities: