Python Celery Autoscaling Kubernetes Python Celery Autoscaling Kubernetes kubernetes kubernetes

Python Celery Autoscaling Kubernetes


The chain of events here is:

  1. The HorizontalPodAutoscaler decreases the replicas: on the Deployment it controls.
  2. The Deployment decreases the replicas: on its corresponding ReplicaSet.
  3. The ReplicaSet deletes Pods as required.
  4. Kubernetes sends each container SIGTERM and waits for it to shut down.
  5. If the container hasn't already exited, it sends each container SIGKILL.

The shutdown sequence in particular is described in Termination of Pods. Your process will get SIGTERM, and then SIGKILL 30 seconds later if it hasn't already exited. Nothing is special about the HPA deleting a pod as opposed to any other path.