I am building an app that has some microservices deployments on a GKE cluster with a n1-standard-2
node.
Since it is a small app with sporadic and little traffic, there maybe instances when my app does not receive traffic for some time.
To reduce costs.
If this is possible, how can I do this in GKE?
If this is not feasible, what other options can I use to reduce costs?
norbjd had already mentioned to you that it is possible configure a cluster autoscaler and specify a minimum of 0 nodes for your node pool if you wish to do so.
Understand that with Kubernetes version 1.7, you can specify a minimum size of zero for your node pool. This allows your node pool to scale down completely if the instances within aren't required to run your workloads. (i.e. do not get charged when not in use)
All you have to do is set your minimum amount of nodes to zero and you should be set.
Hope this helps!
You can configure the cluster autoscaler and specify a minimum of 0 nodes for your node pool(s).
From the docs about Minimum and maximum node pool size :
Note: Beginning with Kubernetes version 1.7, you can specify a minimum size of zero for your node pool. This allows your node pool to scale down completely if the instances within aren't required to run your workloads.
You can use the following command to configure the autoscaler on an existing cluster my-cluster
:
gcloud container clusters update my-cluster \
--zone us-central1-a \ # if zonal, region otherwise
--enable-autoscaling --min-nodes 0 --max-nodes 3