Get the App
SLTechnology News&Howtos  ›  Servers  › 

Chapter 2 Nine Analysis takes you to play rancher-Import Cluster

Shulou Source: shulou.com Published: 2022-06-03 04:24:52 09月30日 Update

This series of articles:

Chapter 1: Nine Analysis takes you to play with rancher-installation

Chapter 2: Nine Analysis takes you to play rancher-Import Cluster

1 rancher import k8s cluster

You have installed the k8s cluster. You don't like the crackling keyboard. You only like the mouse sound of Didi. You tell yourself that you are not a typist. So you choose to import the established cluster into rancher.

Open the browser and log in to rancher. Did you see that it is saying hello to you? is it very polite? Do you feel sorry for it if you don't play with it?

I don't know why the designer of rancher chose "cattle" as the mascot, so I searched Kingsoft Ciba, and I knew why.

All right, I admit I digress. Let's import the K8s cluster. After logging in to rancher, select the "add Cluster button" at the top right.

Select Import:

Give your cluster a name, not too ceremonial, just be casual, it has nothing to do with the K8s cluster itself. It's just an alias, a little symbolic. When you have finished writing your name, click the create button.

Well, the next step is more critical, here you need to really associate the K8s cluster with rancher. Is it difficult to see this big pile below? I don't know which one to choose? All right, let's just copy the last one. After copying, do not click "finish", because the initialization time is relatively long, I am afraid you have a sense of frustration, afraid that you doubt life. Listen to me and look down first.

Let's take a look at the following sentence and see what it wants to do. Just look but don't execute the following statement:

Curl-- insecure-sfL https://10.110.101.103/v3/import/wh3x4pzv2lzx7j4z6qh56jkl9qndpnmx9qltrwkn8f862lhvjc9hs4.yaml | kubectl apply-f-

Is it very simple? the function of the statement is to download the custom resource file of rancher for K8s and give it directly to the client kubectl of K8s for execution. That being the case, in order to be more intuitive, let's do it in two steps.

First download the custom resource file for rancher. The statement is as follows:

Curl-- insecure https://10.110.101.103/v3/import/wh3x4pzv2lzx7j4z6qh56jkl9qndpnmx9qltrwkn8f862lhvjc9hs4.yaml-o rancher-imp-k8s.yaml

Kubectl executes the download to the local rancher-imp-k8s.yaml file.

Kubectl apply-f rancher-imp-k8s.yaml

After the execution is successful, go back to the browser and click the finish button.

As you can see from the figure below, rancher is already associated with your K8s cluster.

Click the cluster name to view the dashboard of the current K8s cluster.

Go back to the console and enter the following statement to confirm the status and make sure everything is all right.

Now you can have a strong coffee and savor the whole process.

Tags: Clusters statements selections buttons files names browsers resources or face-to-face relevance browsing login chapter 2 politeness success intuition the following picture no life Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux OPPO Reno Apple Docker Shulou Tech Info