I am using k8s client-go SDK's NodeInterface to get list of all nodes of GKE cluster. API returns the list correctly. When I update (reduce) size of GKE node-pool, some of the worker nodes gets killed. I wait for cluster to become stable.
Invoking same API to list all GKE nodes including one that have got killed. Do I need to wait for some more time to get updated list of worker nodes ? OR Am I missing something here ?
After reducing the node-pool size the node being removed gets status "Cordoned" and after a while disappears from the list. Usually it takes one-two minutes.
Hence you should wait a bit in order to let the cluster to compete node removal.