Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Node auto-provisioning is not working on GKE

I have setup a standard gke cluster ,  for using node-affinity on scaling I have implemented node auto-provision but it is not scaling my nodes.

Note:- when I implemented cluster autoscaling it was scaling the node but when I disabled it and implemented node auto provisioning it is not scaling ,  please help me am I missing some steps here.

I need to implement Node auto-provisioning because I am using node-affinity. 

node.png

here is my deployment file image

nishitkumar_0-1686231432424.png

 

 

Solved Solved
0 7 2,340
2 ACCEPTED SOLUTIONS

gcloud container node-pools update default-pool --labels=app=angular-app

you should use the above command to label it

View solution in original post

7 REPLIES 7

Hello, @nishitkumar Node Auto Provisioning(NAP) is different from Node Affinity, for Node Affinity to work you need to add relevant lables to your nodes and GKE schedules the Workloads on the nodes with relevant tags, Whereas NAP will provision more node pools with compute or memory optimized machines.

I have already tagged my node by label app=angular-app , on that node I have deployed angular application only , please suggest if I want to scale a new worker node it should have that label otherwise my application wont be deployed on that new provisioned node it will be in pending state because I am using node affinity here.

Note:- In my experiment cluster auto scalar works but it doesn't provide that label app=angular-app on new provisioned node.

I need solution for my issue 

GKE has a Concept of node pools and i am assuming you have applied the labels to a node pool, click on edit node pool and now you just need to enable autoscaler with min and max number of nodes per pool. your labels will apply to all nodes under that node pool

I have applied label using this command 

kubectl label nodes <nodename> app=angular-app

when I enabled autoscaler with min and max number it scaled one new worker node by when I checked the label of that new provisioned node the label was not there, only gke-cluster-1-default-pool-04f6ee65-vpv7 is the node that have label app=angular-app but when it scaled the label is not there on the two new worker nodes 

image_2023_06_09T06_54_22_595Z.png

gcloud container node-pools update default-pool --labels=app=angular-app

you should use the above command to label it

Thank @rehman4023  for your help.

Top Labels in this Space
Top Solution Authors