GKE node pools --zone feature does not work

4 views
Skip to first unread message

Rimas Mocevicius

unread,
May 27, 2016, 3:58:39 AM5/27/16
to Containers at Google
Hi there,

Awesome stuff that node pools are now available, but I encountered a problem putting node pools to a different zone than k8s master.
The same problem for one zone GKE cluster or multi-zone one too.

I cannot get node-pool created if I specify the zone:
`gcloud container node-pools create ha-zone-c --cluster=dev-cluster-1 --machine-type=g1-small --disk-size=50 --num-nodes=1 --zone europe-west1-c`
I get this error:
`ERROR: (gcloud.container.node-pools.create) ResponseError: code=404, message=The resource "projects/my_project/zones/europe-west1-c/clusters/dev-cluster-1" was not found`

Have the latest k8s v1.2.4 in GKE clusters and the latest GC SDK as well.

Thanks

Rimas

Robert Bailey

unread,
May 27, 2016, 3:36:44 PM5/27/16
to Containers at Google
The --zone parameter is the zone where your *cluster* exists. If you want to spread node pools across zones, then you need to specify the --aditional-zones parameter when you create your cluster. 

Right now you can't convert a single-zone cluster into a multi-zone cluster, but we realize that is an issue for some users and are working on a solution. 


--
You received this message because you are subscribed to the Google Groups "Containers at Google" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-contain...@googlegroups.com.
To post to this group, send email to google-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-containers.
For more options, visit https://groups.google.com/d/optout.

Rimas Mocevicius

unread,
May 27, 2016, 3:47:32 PM5/27/16
to Containers at Google
Robert,

As I have mentioned I have tried in multi-zone cluster (used --aditional-zones parameter) as well had no luck
to create in additional zones, just only in the main where master is.

Docs should be more clear how to use node pool features :-)

Thanks 

Rimas

Robert Bailey

unread,
May 27, 2016, 3:51:43 PM5/27/16
to Containers at Google
On Fri, May 27, 2016 at 12:47 PM, Rimas Mocevicius <rmo...@gmail.com> wrote:
Robert,

As I have mentioned I have tried in multi-zone cluster (used --aditional-zones parameter) as well had no luck
to create in additional zones, just only in the main where master is.

What do you mean that you had no luck? You will see a single node pool, but the VMs created will exist in multiple zones (you won't see a node pool per zone). 

Rimas Mocevicius

unread,
May 27, 2016, 4:24:10 PM5/27/16
to Containers at Google
Robert,

I'm getting the same error for multi-zone as for single zone:
ERROR: (gcloud.container.node-pools.create) ResponseError: code=404, message=The resource "projects/my_project/zones/europe-west1-c/clusters/dev-cluster-1" was not found

Robert Bailey

unread,
May 27, 2016, 4:57:52 PM5/27/16
to Containers at Google
That's a node pool create error. Can you try:

gcloud container clusters create multi-zone --zone=europe-west1-a --additional-zones=europe-west1-c,europe-west1-d

and then should should have a single node pool (named default) that has VMs in three zones in the europe-west1 region. 

Rimas Mocevicius

unread,
May 28, 2016, 7:43:41 AM5/28/16
to Containers at Google
Robert,

I'm able to create multizone GKE clusters without any problems.

OK, tried to set a new cluster:
$ gcloud container clusters create development-cluster-2 \
     --zone europe-west1-b \
     --additional-zones=europe-west1-c,europe-west1-d \
     --machine-type g1-small \
     --num-nodes 2 \
     --disk-size 50

$ gcloud container clusters list
NAME                   ZONE            MASTER_VERSION  MASTER_IP      MACHINE_TYPE  NODE_VERSION  NUM_NODES  STATUS
development-cluster-2  europe-west1-b  1.2.4           130.211.xx.xx  g1-small      1.2.4         6          RUNNING

Now creating the node pool in zone C:
$ gcloud container node-pools create ha-zone-c --cluster=development-cluster-2 --machine-type=g1-small --disk-size=50 --num-nodes=1 --zone europe-west1-c
ERROR: (gcloud.container.node-pools.create) ResponseError: code=404, message=The resource "projects/my_project/zones/europe-west1-c/clusters/development-cluster-2" was not found.

Now creating the node pool in zone B where the GKE Master is hosted:
$ gcloud container node-pools create ha-zone-b --cluster=development-cluster-2 --machine-type=g1-small --disk-size=50 --num-nodes=1 --zone europe-west1-b
Creating node pool ha-zone-b...|

So the problem is with creating node pools in the zones which were added as "--additional-zones=europe-west1-c,europe-west1-d"

Thanks

Rimas

Rimas Mocevicius

unread,
May 28, 2016, 7:59:10 AM5/28/16
to Containers at Google
Ok, did more digging

so the commands: " gcloud container node-pools create ha-zone-b --cluster=development-cluster-2 --machine-type=g1-small --disk-size=50 --num-nodes=1 --zone europe-west1-b"
bit "-zone europe-west1-b" is to tell in which zone your cluster is set and creates 1 node per zone

So it does not look like you cannot create a node pool just in one zone for multi zone clusters

Robert Bailey

unread,
Jun 3, 2016, 12:47:22 AM6/3/16
to Containers at Google
You are correct -- node pools must exist across all zones in a multi-zone cluster. The intent is to have a consistent resource footprint across all zones. Due to the behavior of the default k8s scheduler, this will result in the least amount of surprise because applications should be spread more evenly across zones. 
Reply all
Reply to author
Forward
0 new messages