Skip to content

Commit

Permalink
fix: hpa manages Deployment.replicas when configured
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rsicart authored and JAORMX committed Apr 15, 2024
1 parent 8d0cc7d commit 786a6a7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 786a6a7

Please sign in to comment.