X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2Finfrastructure%2Fsubcharts%2Fkong%2Ftemplates%2Fpdb.yaml;h=8d918c5a5b400b889eeac4f92615cb5075fef552;hb=HEAD;hp=39b3b770b2847ca35b3ac02b4b7835f5a132b3f9;hpb=4c278289d5bcb55892d99151310cb1df046f5d52;p=ric-plt%2Fric-dep.git diff --git a/helm/infrastructure/subcharts/kong/templates/pdb.yaml b/helm/infrastructure/subcharts/kong/templates/pdb.yaml old mode 100755 new mode 100644 index 39b3b77..8d918c5 --- a/helm/infrastructure/subcharts/kong/templates/pdb.yaml +++ b/helm/infrastructure/subcharts/kong/templates/pdb.yaml @@ -1,8 +1,15 @@ {{- if .Values.podDisruptionBudget.enabled }} -apiVersion: policy/v1beta1 +{{- if and (not .Values.autoscaling.enabled) (le (int .Values.replicaCount) 1) }} +{{- fail "Enabling PodDisruptionBudget with replicaCount: 1 and no autoscaling prevents pod restarts during upgrades" }} +{{- end }} +{{- if and .Values.autoscaling.enabled (le (int .Values.autoscaling.minReplicas) 1) }} +{{- fail "Enabling PodDisruptionBudget with autoscaling.minReplicas: 1 prevents pod restarts during upgrades" }} +{{- end }} +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ template "kong.fullname" . }} + namespace: {{ template "kong.namespace" . }} labels: {{- include "kong.metaLabels" . | nindent 4 }} spec: @@ -15,4 +22,5 @@ spec: selector: matchLabels: {{- include "kong.metaLabels" . | nindent 6 }} + app.kubernetes.io/component: app {{- end }}