Kubernetes affinity and auto scaling behaviour

2/25/2021

I have a cluster with a node pool and a given label on the node pool. The cluster has auto scaling activated, with a minimum of 0 and a max of 2 nodes.

When I create a pod with an affinity matching the label, no node is created from the pool to schedule the pod on it.

If a machine of the pool is already up, the pod is scheduled on it as expected. Else, if no machine exists, the pod stays unschedulable. What do I have to do to make sure a node is created when a pod with an affinity matching the node pool label comes up ?

Thank you for your help.

-- user9694017
google-kubernetes-engine
kubernetes

1 Answer

2/25/2021

I assume you down sized the node pool manually after the cluster creation, since GKE doesn't let you create the cluster if you set the size as 0 nodes.

Regarding the scaling up issue, it seems that was already reported in this issue tracker. I would suggest you asking on that thread if there is any update or provide more information about your specific configuration.

-- Raul Bautista
Source: StackOverflow