79472001

Date: 2025-02-27 08:32:09
Score: 2
Natty:
Report link

There is a beta functionality that has been available since version 1.22 where you can add the annotation controller.kubernetes.io/pod-deletion-cost with a value in the range [-2147483647, 2147483647] and this will cause pods with lower value to be killed first. Default is 0, so anything negative on one pod will cause a pod to get killed during downscaling. Refer to this documentation for more details on Pod deletion cost.

Check this github Scale down a deployment by removing specific pods (PodDeletionCost) #2255 to know more information about this feature.

However there are a few concerns while using this pod deletion cost, though, such as the fact that it must be done by manually and that the pod-deletion-cost annotation needs to be updated before the replica count is reduced. This implies that any system wishing to use pod-deletion-cost must clear out any outdated pod-deletion-cost annotations. Refer to this github link for more information on this.

On the other hand, Cluster Autoscaler help us to adjust the number of nodes in a cluster based on pod scaling which can be essential for handling empty nodes efficiently. While it doesn't directly control pod removal from all nodes,it ensures that the number of nodes is managed in such a way that empty nodes are removed. Refer to this official GCP documentation for more details on cluster autoscaler.

Reasons:
  • Blacklisted phrase (1): this document
  • RegEx Blacklisted phrase (1): help us
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Imran Premnawaz