Tutorials | Create your first Kubernetes cluster on GKE

Article by the only cloud technology translation, if reproduced, must be marked reproduced from the "only cloud technology."

You may have already learned about Kubernetes and the Google Cloud platform, but you may not have actually created a cluster. Here, we will lead you to sort out some basic knowledge, follow the tutorial step by step, you will create their own operation of the cluster.

Create your Google Cloud project

If you do not have a Google Account, then create one before you proceed to the step.
Log in to Google Cloud Platform Console and create a new project:

屏幕快照_2016-05-18_上午10.11_.00_.png

Write down item ID. The name is unique on all Google Cloud projects, special, we call this called PROJECT_ID.
Next, open the billing function in the console. You need this to access Google Cloud Resources. Next, open the container engine API and the calculation engine API. Before proceeding to the next step, you have to complete these three steps.
Running the steps I mentioned in this blog post will not cost you too much money. But if you want to use more resources, or you let me mentioned the steps have been running, then you will spend a lot of you. Click to view the Google Container Engine Charges to learn more.
Google Cloud platform new users have $ 300 free trial balance.

Introduction: Google Cloud Shell

Google Cloud and Kubernetes can be remotely operated from your laptop, and there is another solution.
Google Cloud Shell (free) is a command-line environment based on the browser running in the cloud. To load this Docker container based on the Debian operating system, you need these deployment tools: docker, gcloud, kubectl, and so on. It provides a 5GB catalog and runs on top of Google Cloud, which greatly improves network performance and reduces the trouble of authentication.
Start the Google Cloud Shell, pick the project you want from the Google Cloud Platform dashboard, and pick the console button on top of the nav.

屏幕快照_2016-05-18_上午10.12_.12_.png

Note: Google Cloud Shell preloaded in the Google Cloud SDK. If you want to use the SDK locally, please click on the "Quick Find Guide" ( https://cloud.google.com/conta … start ) for more information.

Create your GKE cluster

Ok, after all the things are set up, now we're starting to create a cluster. There are two ways to create a GKE cluster: through the cloud platform console or through the gcloud CLI. We will show how to use these two methods. Related information can also be found here: https://cloud.google.com/container-engine/docs/ .

Create a cluster from the cloud platform console

Let's take a look at the visualization.
A cluster includes a master API server hosted by Google and a worker node.
Let's create a cluster with three n1-standard-2 nodes.
Go to your container engine page and find this page by going to the Hamburg menu in the upper left corner. Next, go to the container cluster and click "Create a container cluster".
You will see this page:

屏幕快照_2016-05-18_上午10.12_.57_.png

When you're done, click "Create". It takes a few minutes to complete this step. Upon completion, you will see such a page:

屏幕快照_2016-05-18_上午10.13_.54_.png

As for what these terms mean in the refreshing page, please check out my previous: https://deis.com/blog/2016/kub … pt-1 / .
These nodes are computational engine virtual machines, so you can see in the console:

屏幕快照_2016-05-18_上午10.14_.34_.png

We can also ssh them! Note that the Kubernetes node is managed by the container engine, so you can not ssh to that machine. You now have a full-featured Kubernetes cluster, GKE-driven! So, this is the visual route. So how about the CLI?

Create a cluster through the GCLOUD CLI

You can use the command to create a single Kubernetes cluster on the GKE, as shown in the following figure:

屏幕快照_2016-05-18_上午10.15_.21_.png

Note that the new –additional-zones parameter.
These two commands create a three-zone Kubernetes cluster, each with three nodes. So, a total of 9 nodes. All nodes share the same master, and all the workloads are evenly distributed to the nine nodes. Click: https://cloud.google.com/sdk/g … reate to view the document on gcloud, or click: http://kubernetes.io/docs/admin/multiple-zones/%5D URL to see more information.

Set the gcloud default settings

Let's take a look at setting the gcloud system defaults in our cloud shell so that kubectl knows which cluster to connect to.
Configure your PROJECT_ID as follows

屏幕快照_2016-05-18_上午10.16_.01_.png

perfect!

Conclusion

We take you here today to see the Google cloud platform, open the billing function, open the relevant API, and then create a GCE above the Kubernetes cluster. Finally, when we complete the experiment, do not forget to stop the example.

Article by the only cloud technology translation, if reproduced, must be marked reproduced from the "only cloud technology." Please click the "Original link" to view the original.

图片_1副本.png

    Heads up! This alert needs your attention, but it's not super important.