django-helm-chart/templates/web/pdb.yaml
David Burke a94054df32 Sanity check replicaCount when determining if using PDB to avoid pods
that cannot be terminated, which causes k8s upgrades to fail.
2021-07-10 14:54:37 -04:00

19 lines
606 B
YAML

{{- if or (and .Values.web.autoscaling.enabled (gt (.Values.web.autoscaling.minReplicas | int) 1)) (gt (.Values.web.replicaCount | int) 1) }}
{{- if .Values.web.budget -}}
{{- if .Values.web.budget.minAvailable -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ include "django.fullname" . }}-web
labels:
{{- include "django.labels" . | nindent 4 }}
spec:
minAvailable: {{ .Values.web.budget.minAvailable }}
selector:
matchLabels:
{{- include "django.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: web
{{- end -}}
{{- end -}}
{{- end -}}