Pod Allocation & Rebalancing in Production Kubernetes Cluster using Topology Spread & Descheduler

Published: 10 April 2023
on channel: networknutsdotnet
1,595
40

Kubernetes does not rebalance your pods automatically. So whenever you add a new node in cluster the pods are not automatically rebalanced. But thats a need in production grade or dynamic kubernetes cluster running either on public / private cloud platform.

In this video you will learn how to configure proper spread of pods across nodes using "topology spread". Topology spread is good solution when you are deploying new applications. It will not affect the application / deployments which are already running. With topology spread constraints, you can pick the topology and choose the pod distribution (skew), what happens when the constraint is unfulfillable (schedule anyway vs don’t) and the interaction with pod affinity and taints.

But, as I have told earlier that It does not apply retroactively — you can still delete the pods and force the scheduler to reallocate them. Which might not be a good solution.

Second problem in a production grade kubernetes cluster is when cluster got updated with new nodes. The existing load of pods will not be "rebalanced" on new nodes, automatically. Now thats a real problem.

Solution is to use "kubernetes descheduler". Which runs as a cronjob and constantly scans your cluster at regular intervals, and if it finds a node that is more utilized than others, it deletes a pod in that node.

Unfortunately, both topics are not part of standard CKA curriculum.

Visit us - https://networknuts.net
Social - /networknuts


Watch video Pod Allocation & Rebalancing in Production Kubernetes Cluster using Topology Spread & Descheduler online, duration hours minute second in high quality that is uploaded to the channel networknutsdotnet 10 April 2023. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,595 times and liked it 40 visitors.