Create Google Container Engine Cluster Without Default Node Pool

google-cloud-platformgoogle-compute-enginegoogle-kubernetes-engine

When I create a cluster on Google Cloud's Container Engine, e.g. using

gcloud container clusters create my-cluster --zone=my-zone

a node pool ("default-pool") is created as well. I don't want this default pool to be created – I want to manually create my own node pools in order to have full control over what nodes are actually being created by the cluster.

Is there any way to create a cluster in Container Engine without creating the associated default node pool?

The obvious workaround that I'm using right now is to create the cluster, add my own node pools, then delete the default node pool, but it would be better if I didn't have to go through this extra step (plus the default pool setup/deletion incurs unnecessary wait time while creating the cluster).

I'm aware of options like --machine-type, --num-nodes, etc. for gcloud container clusters create, but specifying those doesn't matter because the default node pool still gets created, which is what I'm trying to avoid.

Best Answer

You cannot do this using gcloud or the cloud console, but you can achieve what you are trying to do if you use the raw GKE API. In the request body you would need to specify multiple NodePool objects, putting in the name you'd like for each one. You can make programmatic calls using a client library so that you don't have to craft raw HTTP requests by hand.

Related Topic