In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to create your first Kubernetes cluster on GKE. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.
You may have learned about Kubernetes and Google cloud platforms, but you may not have actually created a cluster yet. Here, we will take you through some of the basics, follow this tutorial step by step, you will create your own running cluster.
Create your Google Cloud Project
If you don't already have a Google account, create one before you proceed.
Log in to the Google Cloud platform console and create a new project:
Then change the project name
Write down the project ID. This name is unique and special on all Google Cloud projects, and we call it PROJECT_ID.
Next, turn on the billing function in the console. You need this to access Google Cloud Resources. Next, open the container engine API and the computing engine API. You must complete these three steps before moving on to the next step.
It won't cost you much money to run the steps I mentioned in this blog post. But if you want to use more resources, or if you let the steps I mentioned run all the time, it will cost you a lot. Click to see "Google Container engine charges" for more information.
New users of Google's cloud platform have a free trial balance of $300.
Introduction: Google Cloud Shell
Google Cloud and Kubernetes can be operated remotely from your laptop. Here is another solution.
Google Cloud Shell (free) is a command line environment based on browsers 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 continuous 5GB directory and runs on Google Cloud, greatly improving network performance and reducing the hassle of authentication.
Launch Google Cloud Shell, select the project you want from Google Cloud platform dashboard, and then select the console button on nav.
It only takes a little time to provide and connect to the environment. After that, you will see the page shown in the following figure:
Once connected, you have been certified:
And the PROJECT_ID environment variable has been set for you:
Before we proceed, let's update the gcloud component:
Note: Google Cloud Shell is pre-installed in Google Cloud SDK. If you want to use SDK locally, please click the Quick Learning Guide (https://cloud.google.com/container-engine/docs/quickstart) for more information.
Create your GKE cluster
Okay, after everything is set up, let's start creating a cluster. There are two ways to create a GKE cluster: through the cloud platform console or through gcloud CLI. We will next show how to use these two methods. Related information can also be viewed here: https://cloud.google.com/container-engine/docs/.
Create a cluster through the cloud platform console
Let's first take a look at visual routing.
A cluster consists of master API servers dominated by Google and a set of worker nodes.
Let's create a cluster with three n1-standard-2 nodes.
Go to your container engine page, which can be found on the hamburger menu in the upper left corner. Next, go to the container cluster and click "create a container cluster".
You will see this page:
When you are finished, click create. It will take several minutes to complete this step. When you're done, you'll see a page like this:
Now the effect of the cluster looks like this:
As for what these terms mean on the refreshed page, please check out my previous: https://deis.com/blog/2016/kubernetes-overview-pt-1/.
These nodes are computing engine virtual machines, so you can see them in the console:
We can also ssh them! Note that the Kubernetes node is managed by the container engine, so you cannot ssh to that machine. You now have a fully functional Kubernetes cluster, GKE-driven! So, this is visual routing. So what about CLI?
Create a cluster through GCLOUD CLI
You can create a single-zone Kubernetes cluster on GKE with the command, as shown in the following figure:
In order to create a highly available multi-zone (same region) Kubernetes cluster on GKE, we can respond to the command.
Like this:
Notice the new-- additional-zones parameter.
These two commands create a three-zone Kubernetes cluster with three nodes in each zone. So, there are a total of nine nodes. All nodes share the same master, and all workloads are evenly distributed among the nine nodes. Click: https://cloud.google.com/sdk/gcloud/reference/container/clusters/create to view the document on gcloud, or click: http://kubernetes.io/docs/admin/multiple-zones/%5D URL for more information.
Set 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
Set the default calculation engine area:
You can set up the cluster according to the default value of the system, so you can remove the-cluster CLUSTER_NAME flag from the later gcloud command. The practice is as follows:
Similarly, get the cluster credentials for the kubectl tool:
The credentials are stored in ~ / .kube / config. Click to view:
Perfect!
This is all about how to create your first Kubernetes cluster on GKE. I hope the above content can be of some help and learn more. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.