Wunderbread
Wunderbread

Reputation: 1070

What status do pods go into during HorizontalPodAutoscaler scaling down

I was reviewing some of the HorizontalPodAutoscaler docs here: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/ along with several other resources and I haven't been able to identify what pod status occurs during when HPA is actually scaling down. I'd imagine this goes from running to terminated but there's no mention of this in the docs.

Upvotes: 0

Views: 88

Answers (1)

David Maze
David Maze

Reputation: 159485

The HPA will change the Deployment's replicas: value, and which will change the replicas: value in the current ReplicaSet, which will cause one of the Pods to get deleted. From the Pod's point of view this is the same as any other situation when a Pod gets deleted, including manual scale-in or updating the Deployment spec.

The "status" column in the kubectl get pods output should match the Pod phase, except that Terminating and Terminated are special values. If the Pod shuts down immediately I would expect it to jump from Running to Terminated, but it might wait in Terminating if it takes some time to do its cleanup after receiving the termination signal.

Upvotes: 1

Related Questions