Taking reference to this answer, in my case, I have an MIG with an autoscaler set with:
- minNumReplicas: 0
- a custom, per-group Cloud Monitoring metrics that is generated from an external application outside of the MIG instances.
Theoretically, this should allow me to scale to 0.
However, the targetSize
and recommendedSize
of my MIG always stays at 1, even when my metric is definitely below the utilization target set. (I have tested that the scaling up and down between 1 and my maxNumReplicas work)
I even tried to force a resize to 0, using gcloud compute instance-groups managed resize my-mig --size=0
. This initially shows me a targetSize
of 0, while the autoscaler.recommendedSize
continues to remain at 1. A few seconds later, targetSize
bounces back to 1, and I have this annoying instance that just won't go away.
Is this behaviour expected? How can I force recommendedSize to 0 (or essentially how can I make the MIG to go down to 0, which is the minNumReplicas that I have set)?