Get the App
SLTechnology News&Howtos  ›  Servers  › 

Steps for rancher to install a kubernetes cluster

Shulou Source: shulou.com Published: 2022-06-03 04:33:19 09月27日 Update

This article is to share with you rancher installation kubernetes cluster detailed installation tutorial, I believe that most people do not know how to install, in order to let you learn, to give you a summary of the following content, needless to say, let's read on.

1. Installation

Yum install docker-y # install docker

Systemctl enable docker # Boot starts automatically

Docker run-d-- restart=unless-stopped-p 80:80-p 443 rancher/rancher:stable

# pull rancher creation

two。 Log in and create a cluster

Account password admin admin

Create a cluster and add master nodes

# create and enable name for the cluster

# master node needs to check Etcd,contorl, and then copy the following code to the host of master to run.

3 add node node

# clusters created in the first selection

# Select a host and edit the cluster

# move to the last copy code and run it on the node node. Of course, the docker of the node node should be installed and started.

# it is recommended to go to the nodo node first and execute docker pull rancher/rancher-agent:v2.3.3 to pull down the image in advance.

# after installation, you can find that rancher can detect the node node.

4. Create pod

# Select cluster first, select namespace, and select deployment service in workload

# setting the name image path, etc., to complete the deployment is much more convenient than writing the yaml file

5. Install kubectl

Curl-LO https://storage.googleapis.com/kubernetes-release/release/v1.16.3/bin/linux/amd64/kubectl

# download the kubectl script, pay attention to the corresponding version. If you want to download 1.17, change the 1.16.3 above.

Chmod + x kubectl # give permission to run

Mv kubectl / usr/local/bin/kubectl # move to the running directory

[root@cs25] # mkdir ~ / .kube

[root@cs25] # cd ~ / .kube/

[root@cs25 .kube] # vim config

# go to rancher and copy out the configuration file of kubectl and paste it into the file above

# Test and view the node node

The above can be used, but the command cannot be completed. Set the completion function below.

Echo 'source

Tags: Clusters nodes selection run code files monitoring content tutorials more storage mobility good success hosts information functions names commands icons Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Shulou Technology Xiaomi Docker