For ReplicaSets
I see there is a way to use a Horizontal Pod Autoscaler (HPA) and set a max/min value for the number of replicas allowed. Is there a similar feature for StatefulSets
? Since it also allows you to specify the number of replicas to deploy initially? For example, how would I tell Kubernetes to limit the number of pods it can deploy for a given StatefulSets
?
Asked
Active
Viewed 2,979 times
2

Wytrzymały Wiktor
- 11,492
- 5
- 29
- 37

Jim
- 119
- 4
- 14
-
First sentence in the documentation: "The Horizontal Pod Autoscaler automatically scales the number of Pods in a replication controller, deployment, replica set or stateful set" - https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ – Jonas Oct 13 '21 at 19:17
-
Thanks, @Jonas! I somehow missed that in the docs. – Jim Oct 13 '21 at 20:17
1 Answers
1
I have posted community wiki answer for better visibility. Jonas well mentioned in the comment:
First sentence in the documentation:
"The Horizontal Pod Autoscaler automatically scales the number of Pods in a replication controller, deployment, replica set or stateful set"
summary, it is possible to set min / max replicas for a statefulset using HPA. In this documentation you will learn how HPA works, how to use it, what is supported etc. HPA will not work only with the objects that can't be scaled, for example, DaemonSets.
See also this related question.

Mikołaj Głodziak
- 4,775
- 7
- 28