Rancher profile

Rancher is an open source, enterprise-level container management platform. With Rancher, businesses no longer have to build container services platforms from scratch using a suite of open source software. Rancher provides a full-stack container deployment and management platform for Docker and Kubernetes for use in production environments.

Install Rancher2.4.5

Rancher’s GitHub address is as follows, and the corresponding release can be found:

https://github.com/rancher/rancher/releases
Copy the code
① Find the following files, download them, and upload them to the server

2 Run the following command in the upload directory to package the image
// Grant permission
chmod +x rancher-save-images.sh
    
// It is slow to start pulling images from foreign servers
./rancher-save-images.sh --image-list ./rancher-images.txt
Copy the code

③ The packed directory structure is as follows

4 Upload the file to the Intranet server
// Grant permissions
chmod +x rancher-load-images.sh
    
// Log in to docker repositoryDocker login REGISTRY.YOURDOMAIN.COM: PORT -u username -p password// Upload the command to the warehouse. The command takes a long time. Please wait patiently
./rancher-load-images.sh --image-list ./rancher-images.txt --registry <REGISTRY.YOURDOMAIN.COM:PORT>
Copy the code

Resolve HTTPS error:

// We need to edit the release IP
vim /etc/docker/daemon.json
    
// Add "insecure-registries":["192.168.1.103"]
{
    "insecure-registries": ["192.168.1.103"]
}

systemctl daemon-reload
systemctl restart docker
Copy the code
(5) deployment Rancher
docker run -d --restart=unless-stopped \
 
-p 80:80 -p 443:443\ - e CATTLE_SYSTEM_DEFAULT_REGISTRY = < REGISTRY.YOURDOMAIN.COM: PORT > \ # set the default system image - e CATTLE_SYSTEM_CATALOG = bundled \ # warehouse Since the v23.. 0Available, use the built-in Rancher system charts < REGISTRY.YOURDOMAIN.COM: PORT > / Rancher/Rancher: < RANCHER_VERSION_TAG >Copy the code

Example:

docker run -d --restart=unless-stopped -p 80:80 -p 443:443 -e CATTLE_SYSTEM_DEFAULT_REGISTRY=192.1681.103. -e CATTLE_SYSTEM_CATALOG=bundled 192.1681.103./rancher/rancher/rancher:v24.. 5-rc10
Copy the code
⑥ After the startup, access the host name can see the home page, set a password to enter

6.1. Set up the warehouse

Click “Settings” -> “system-default-registry” to set the default repository address

6.2. Adding a Cluster

Choose Cluster > Add Cluster > Customize

Kubernetes version = 1.16.13; note that you can select the address of the mirror repository, if there is a separate namespace need to change to IP:HOST/ space name.

Click Next, select Etcd and Control, and copy the command at the bottom to the VM:

Error resolution:

Rke-tools :v0.1.59 cannot be found. The main reason is that the version of RKE-Tools is v0.1.58 and the version of rKE-Tools is v0.1.59. We need to manually pull the Psuh
docker pull rancher/rke-tools:v01.59.
docker tag rancher/rke-tools:v01.59. 192.1681.103./rancher/rancher/rke-tools:v01.59.
docker push 192.1681.103./rancher/rancher/rke-tools:v01.59.

/ / (2) reported No to image: 192.168.1.103 / rancher/rancher/hyperkube: v1.18.6 - rancher1
docker pull rancher/hyperkube:v117.9.-rancher1
docker tag rancher/hyperkube:v117.9.-rancher1 192.1681.103./rancher/rancher/hyperkube:v117.9.-rancher1
docker push 192.1681.103./rancher/rancher/hyperkube:v117.9.-rancher1
Copy the code
⑦ Configure Kubectl client (if version 2.4.5 can not configure this step)

Download the tar package

wget https:/ / storage.googleapis.com/kubernetes-release/release/v1.16.13/kubernetes-client-linux-amd64.tar.gz
Copy the code

Unzip and create the “.kube” directory in the root directory

/ /
tar -xvf kubernetes-client-linux-amd64.tar.gz

// create the.kube directory
mkdir -p /root/.kube

// Create config file
touch /root/.kube/config 
Copy the code

Edit config and copy the files from Rancher into it

Rancher is shown below when it is running

⑧ Deploying services

Enter the EOS-test host in Rancher’s cluster, select Default, and click Deploy Service

Deploy our pre-stored Tomcat image as follows

To set the minimum memory space,” Advanced Settings “->” Security/Host Settings “is as follows

Error:

ReplicaSet "nginx-5bddc7d447" has timed out progressing.; Deployment does not have minimum availability.
Copy the code

This problem occurs because only a single host is deployed and cannot form a cluster. Solution:

At least two hosts, one master and one worker are recommended2Nuclear 4 gCopy the code