Redistribute pods across AKS node-pools

FedericoZarelli-6386 20 Reputation points
2024-12-06T17:32:27.0233333+00:00

Is there a safe way to restart a node pool to force/induce kubernetes scheduler to redistribute pods across node-pools?

Context:
I recently upgraded the SKU of my system node-pool and I would like all/most of the system pods running on user node-pools to be re-allocated there. I have taints and tolerations correctly set on nodes and pods to induce this behaviour.

Thanks!

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,205 questions
{count} votes

Accepted answer
  1. deherman-MSFT 37,831 Reputation points Microsoft Employee
    2024-12-10T19:03:12.64+00:00

    @FedericoZarelli-6386

    You should be able to do this by Draining and Uncordoning Nodes.

    Drain the nodes: kubectl drain <node-names> --ignore-daemonsets --delete-emptydir-data, using a space-separated list of node names.

    Stop the Node Pool: az aks nodepool stop --resource-group <resource-group> --cluster-name <cluster-name> --nodepool-name <nodepool-name>

    Start the Node Pool: az aks nodepool start --resource-group <resource-group> --cluster-name <cluster-name> --nodepool-name <nodepool-name>

    Uncordon the Node Pool: kubectl uncordon <node-name>

    Hope this helps! Let me know if you have issues or need further assistance.


    If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.

    If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you for helping to improve Microsoft Q&A! User's image


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.