diff --git a/ci/kind-values.yaml b/ci/kind-values.yaml index 453cf7f..4cbff4a 100644 --- a/ci/kind-values.yaml +++ b/ci/kind-values.yaml @@ -1,4 +1,8 @@ # test CI values for K8S kind deployment +magento: + podDisruptionBudget: + enabled: true + opensearch: extraEnvs: - name: DISABLE_SECURITY_PLUGIN diff --git a/templates/pdb.yaml b/templates/pdb.yaml new file mode 100644 index 0000000..4aeb1a5 --- /dev/null +++ b/templates/pdb.yaml @@ -0,0 +1,22 @@ +{{- if .Values.magento.podDisruptionBudget.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "magento.name" . }}-pdb + annotations: {{ toYaml .Values.magento.annotations | nindent 4 }} + labels: + {{- include "magento.labels" . | nindent 4 }} + {{- range $key, $val := ($.Values.magento.labels | default dict) }} + {{ $key }}: {{ $val | quote }} + {{- end }} +spec: + {{- if .Values.magento.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.magento.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.magento.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.magento.podDisruptionBudget.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "magento.selectorLabels" . | nindent 6 }} +{{- end -}} diff --git a/values.yaml b/values.yaml index fba0703..22292b6 100755 --- a/values.yaml +++ b/values.yaml @@ -61,6 +61,10 @@ magento: maxSurge: 100% maxUnavailable: 0 type: RollingUpdate + podDisruptionBudget: + enabled: false + minAvailable: 0 + maxUnavailable: 1 podSecurityContext: {} securityContext: {}