Get the gcloud create cmd for a cluster created through the GCP UI

9/14/2019

Is there an easy way to get the gcloud container clusters create ... command details for an existing cluster? (... Command that can be used to create the exact same cluster)

Someone from my team created a cluster on GKE through the UI with specific region and machine type details, and a few other customizations I can't remember. I'll be deleting the cluster, as it was for a test. We may need to recreate it and for this, instead of running through the UI, I was hoping to document the gcloud command that can be used to create the same cluster.

I couldn't find anything on the GCP UI to help with this. We can through the docs (https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster) construct the cmd that might build the same cluster, but wanted to check if there was a better way.

-- Prashant
gcloud
google-cloud-platform
google-console-developer
google-kubernetes-engine

2 Answers

1/17/2020

I recently was trying to get the gcloud command that can be used to recreate an existing cluster

I found a way to get the gcloud command with the parameters by going to your GKE-->create Cluster-->Clone an existing Cluster-->choose your Cluster and at the bottom you will have the Rest/command-line option.

-- Mohamad Bazzi
Source: StackOverflow

9/14/2019

You can create your cluster on the GUI and use the button on the bottom to generate the HTTP Rest command or the Gcloud command line. You can find this on several pages in the GUI.

GKE create cluster page

-- guillaume blaquiere
Source: StackOverflow