Why my k8s deployment on Azure AKS was scaled on single node pools only?

42 Views Asked by At

I have a hello-world app that was deployed on AKS with HPA enabled.

I have 2 these node pools:

enter image description here

I haven't set any node assignment configuration yet: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/

FYI:

  • spotnode pools have autoscaling from 0-2 nodes
  • agentpool pools have manual scaling with fixed 1 node.

Current behavior:

  • When HPA performed, pods are created and got running on agentpool only

My expectation is:

  • I want my pods will be created on spotnodes + other node pools, except the agentpool

Question 1: How can I achieve this expectation, I know 1 possible way is to follow the link?

Question 2: Why my k8s deployment on Azure AKS was scaled on single node pools (agentpool) only?

1

There are 1 best solutions below

2
Neo.Mxn0 On

Question 1: How can I make pods created on spotnodes + other node pools, except the agentpool?

  • Use node affinity

Question 2: Why my k8s deployment on Azure AKS was scaled on single node pools (agentpool) only?

  • Because spotnodes pool have no active nodes, and because of the reason below.
  • Do not use GUI to configure nodepool scaling, it will not work (at this time), you need to use Azure CLI to configure autoscaling for your nodepool.