Skip to content

Commit

Permalink
fix: do not set pdb when Deployment/hpa/keda replicas are too low
Browse files Browse the repository at this point in the history
  • Loading branch information
rsicart authored and JAORMX committed Apr 24, 2024
1 parent ea4b7f4 commit ec9951d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion templates/poddistruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{{- if .Values.podDisruptionBudget.enabled -}}
{{- $replicas := .Values.replicaCount }}
{{- if and .Values.autoscaling.enabled (not .Values.keda.enabled) }}
{{- $replicas = .Values.autoscaling.minReplicas }}
{{- else if and .Values.keda.enabled (not .Values.autoscaling.enabled) }}
{{- $replicas = .Values.keda.minReplicas }}
{{- end }}
{{- if gt ($replicas | int) 1 }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
Expand All @@ -18,4 +25,5 @@ spec:
selector:
matchLabels:
{{- include "krakend.selectorLabels" . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit ec9951d

Please sign in to comment.