From 786a6a75443457a9a9464dd642a21d0ccfc25991 Mon Sep 17 00:00:00 2001 From: "R.Sicart" Date: Mon, 15 Apr 2024 12:19:08 +0200 Subject: [PATCH] fix: hpa manages Deployment.replicas when configured As documented: If a HorizontalPodAutoscaler (or any similar API for horizontal scaling) is managing scaling for a Deployment, don't set .spec.replicas. https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#replicas --- templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index cf5a76f..4f3564c 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -10,7 +10,9 @@ metadata: labels: {{- include "krakend.labels" . | nindent 4 }} spec: + {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} + {{- end }} selector: matchLabels: {{- include "krakend.selectorLabels" . | nindent 6 }}