1

So here's a sample scenario I'm trying to utilize in terms of K8s node resources.

Let's say we have 3 (worker) nodes - same type - with these resource requests allocated:

  • N1: 70%
  • N2: 60%
  • N3: 50%

I'd like to ideally rebalance the nodes (pods on the node) so it I can delete N3 (or any one of them):

  • N1: 70% + 20% from N3
  • N2: 60% + 30% from N3
  • N3: to be deleted

(all numbers are hypothetical and simplified, I just wanna get to the least waste/least number of nodes required for this)

I'm looking at the descheduler which could potentially help to utilize the nodes/cluster.

I'm thinking to set the threshold = targetThresholds = 90% (or something similar) in LowNodeUtilization policy, and then use either HighNodeUtilization or Cluster Autoscaler to downsize the cluster (i.e. remove the node)

  • I'm not clear if I can use multiple strategies for descheduler (if so, what's the precedence)
  • Should I use the HighNodeUtilization or Cluster Autoscaler for downsizing?

Any comment/feedback on this approach (or any other suggestion) is appreciated.

Mahyar
  • 1,011
  • 2
  • 17
  • 37
  • Is there a reason to not just drain the node and let the cluster delete and recreate the pods? And if you have too few nodes to start everything add the node again with uncordon. https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/ – mszalbach May 28 '22 at 17:55
  • This should be done automatically - whenever resources are under utilized, so I wanna run this as a cronjob. Draining a single node does NOT necessarily rebalance the pods to properly utilize the resources. (and please note that numbers are arbitrary and simplified, I will eventually apply the approach to a production cluster) – Mahyar May 29 '22 at 06:36

0 Answers0