0
votes

I entered the below command to create a cluster, but I get an error stating gcloud container clusters create kubia --num-nodes=3 --machine-type=f1-micro

The above command throws the below error.

ERROR: (gcloud.container.clusters.create) ResponseError: code=403, message=Insufficient regional quota to satisfy request: resource "IN_USE_ADDRESSES": request requires '9.0' and is short '1.0'. project has a quota of '8.0' with '8.0' available. View and manage quotas at https://console.cloud.google.com/iam-admin/quotas?usage=USED&project=k8s-demo-263903.

Then I chose to set the number of nodes to 2

The command created 6 nodes

NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS kubia asia-south1 1.13.11-gke.14 35.200.140.153 f1-micro 1.13.11-gke.14 6 RUNNING

NAME

gke-kubia-default-pool-46a198b9-qdg2
gke-kubia-default-pool-46a198b9-s3xn
gke-kubia-default-pool-72fd11ff-mddd
gke-kubia-default-pool-72fd11ff-qrds
gke-kubia-default-pool-75ecb3b2-1wfq
gke-kubia-default-pool-75ecb3b2-j4cz

Why is that the number of node is getting multiplied with 3 for the nodes mentioned in the command?

2
This might happen if we are selecting more than one zone via the new "Additional Zones" checkbox options when creating a GKE cluster. Check your caseSuresh Gajera
@SureshGajera But I ran the command from the command line and not from the UI to select the checkboxzilcuanu

2 Answers

1
votes

This is an old request, so hopefully you have found your way past it by now, so this is mainly aimed at anyone else who happens across this issue.

It looks like you are following the examples in the Manning Kubernetes in Action (version 1).

I understand that the problem is caused by setting the default compute/zone to a region (e.g. europe-west4) and not to a zone (e.g. europe-west4-a). This results in the effect that @Stefan Neacsu mentioned above. When you launch the cluster, it starts three nodes in each zone (e.g. europe-west4-a, europe-west4-b and europe-west4-c), hence the multiple of three. This is great for stability when you get to deployment, but not what you want when you are just experimenting.

The solution therefore is to use the command: gcloud config set compute/zone <zone_id> where zone_id is the name of a zone and not a region.

See this for a list of zones and regions.

0
votes

By default, a cluster and his nodes run in a single compute zone that you specify when you create the cluster, by adding regional clusters you will increase the availability of both master cluster and his nodes by replication them across multiple zones of a region.

Why is that the number of node is getting multiplied with 3 for the nodes mentioned in the command?

There are some limitations regarding this, like in case you have Additional Zones selected the clusters will consume nine IP addresses.

You should try to reduce the number of nodes down to one per zone, if that is why you desire.

ERROR: (gcloud.container.clusters.create) ResponseError: code=403, message=Insufficient regional quota to satisfy request: resource "IN_USE_ADDRESSES": request requires '9.0' and is short '1.0'. project has a quota of '8.0' with '8.0' available. View and manage quotas at https://console.cloud.google.com/iam-admin/quotas?usage=USED&project=k8s-demo-263903.

In case of this error, since I suppose you have a newly created Google Cloud account you are granted only eight IP addresses per region, so what you may need is to request an increase in your quota for regional in-use IP addresses, depending on the size of your regional cluster.

Basically, the error you got is because you had too few available.

If you do not want to multiple it just reduce the number of zones.