How to deploy a Kubernetes cluster using gcloud command

Find out how to deploy a Kubernetes cluster to the Google Cloud Platform using the gcloud command.


Image: iStockphoto/metamorworks

If your cloud solution runs through the Google Cloud Platform and you happen to prefer managing everything from the command line, you might have installed the Google Cloud SDK on Linux. This software development kit includes the gcloud command, which allows you to interact with your Google Cloud Platform account. 

By way of that interaction, you can deploy a complete Kubernetes cluster. And that’s exactly what I’m going to show you. 

SEE: Hybrid cloud: A guide for IT pros (TechRepublic download)

What you’ll need

The only things you’ll need to make this work are:

  • A Google Cloud Platform account
  • The Google Cloud SDK installed on a Linux machine

Some terms

Before we get to the commands, there are a few terms to understand.

  • Compute zones are locations within a region. For example, you can deploy in us-east1, us-east1-b, us-east1-c, or us-east1-d. For a complete list of zones, see this page
  • Types of clusters: Zonal clusters run in one or more compute zones within a region. Regional clusters run three cluster masters across three compute zones and runs nodes in two or more compute zones. Private clusters are either a zonal or regional cluster which hides both master and nodes from the public. Alpha clusters are an experimental zonal or regional cluster that run with Kubernetes alpha features enabled.
  • Cluster templates are templates that make deploying clusters easier. You can select from standard cluster, Your First Cluster, CPU-Intensive applications, Memory-Intensive applications, GPU Accelerated Computing, and Highly Available. 

How to deploy your first cluster

We’re going to deploy a zonal cluster (in us-central1-a) using the Standard template, which is the default. The command for…