githubEdit

How do I stop a service with HPA enabled in production?

Context When trying to stop a service in production that has Horizontal Pod Autoscaling (HPA) enabled, setting the replica count to 0 through the Terraform configuration or service settings may not work. This is because HPA will automatically scale the service back up based on its configuration. Answer To successfully stop a service that has HPA enabled in production: First, remove the HPA configuration from the service Change the service configuration to use static replicas instead of auto-scaling Set the static replica count to 0 The difference between a service with and without HPA can be seen in these screenshots: Service with static replicas (can be stopped): Service with HPA enabled (cannot be stopped):

Last updated

Was this helpful?