Skip to content

Instantly share code, notes, and snippets.

@ankurshukla
Last active April 17, 2016 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankurshukla/bbcf2a668e1aa80dbdf9a225bee1be78 to your computer and use it in GitHub Desktop.
Save ankurshukla/bbcf2a668e1aa80dbdf9a225bee1be78 to your computer and use it in GitHub Desktop.
## installing gcloud SDK on Mac OS X or Linux machine
curl https://sdk.cloud.google.com | bash
## restarting shell
exec -l $SHELL
## configuring the gcloud environment
gcloud init
## Once you have configured your gcloud environment with the GCP credentials,
## and created a project on the GCP console, you can set that as the default project
## on your gcloud client as well as a default zone
gcloud config set project <your-project-name>
gcloud config set compute/zone us-central1-b
## gcloud comes bundled with kubectl. which is the command line client for running
## kubernetes. You can check this via
kubectl
## simplest way to create a cluster in Google Container Engine is via the GCP console, but you can create
## a default 3 node cluster from command line also via
gcloud container clusters create <cluster-name>
## once you have a cluster running, you can configure your cluster to kubectl so that
## you can use kubectl commands to manage all the resources. This is an important step
## for all migrating users.
gcloud container clusters get-credentials <cluster-name>
## now you can use all/any kubectl commands on your newly created cluster environment
## to get the information of your cluster under kubernetes
kubectl cluster-info
gcloud container clusters describe <cluster-name>
@ankurshukla
Copy link
Author

Keep in mind that Google Container Engine (GKE) is a Google's managed kubernetes-as-a-service. With GKE, the Kubernetes master is managed by Google in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment