Skip to content

Commit

Permalink
#13 add PDB template and test
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-bjoern committed Feb 20, 2024
1 parent 2878b99 commit 9030e0c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ci/kind-values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# test CI values for K8S kind deployment
magento:
podDisruptionBudget:
enabled: true

opensearch:
extraEnvs:
- name: DISABLE_SECURITY_PLUGIN
Expand Down
22 changes: 22 additions & 0 deletions templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 -}}
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ magento:
maxSurge: 100%
maxUnavailable: 0
type: RollingUpdate
podDisruptionBudget:
enabled: false
minAvailable: 0
maxUnavailable: 1

podSecurityContext: {}
securityContext: {}
Expand Down

0 comments on commit 9030e0c

Please sign in to comment.