How to deploy Rancher with Docker (no pitfalls)

How to deploy Rancher with Docker (no pitfalls)

Must read before operation:

Note: If you want to use rancher for management, you need to do it when your k8s cluster is not built. If k8s has already been built, the rancher import cluster function will not be available. You need to build the master and node first. After rancher is started on the master, curl --insecure -sfL ** is the import command on the third line. After the master node is executed, you can execute the kubeadm join command on the node to join the cluster. Note: If the host name is not changed before deploying k8s, do not change it after k8s is deployed. Once changed, your node will be directly NotReady. It is best to change the host name before deployment.

Note: If the following message appears after adding the master to ranche:
Warning: Component controller-manager is unhealthy Warning: Component scheduler is unhealthy

You can do the following:

Master executes to view the cluster status

kubelet get cs

Check if the port is not listening

ss -ant | grep 10251
ss -ant | grep 10252

The pod component is running normally

kubelet get pods --all-namespaces

Check whether the kube-scheduler and kube-controller-manager component configurations have disabled non-secure ports.

vim /etc/kubernetes/manifests/kube-scheduler.yaml
vim /etc/kubernetes/manifests/kube-controller-manager.yaml

If everything is normal, comment port=0 in kube-scheduler.yaml and kube-controller-manager.yaml with # and restart and try again. I commented that it has returned to normal after restarting. If it is not restored, you need to find other methods

systemctl restart kubelet

Security Group

Inbound TCP: 22 80 443 2376 2379 2380 6443 9099 10250-10252 10254 10256 
UDP:4789 8472
30000-32767 TCP/UDP (nodeport)
All outbound traffic

Deploy Docker

sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce -y
sudo systemctl enable docker
sudo systemctl start docker

Start Rancher

sudo docker run --privileged -d --restart=unless-stopped \
 -p 80:80 -p 443:443 \
 -v /host/rancher:/var/lib/rancher \
 -v /var/log/rancher/auditlog:/var/log/auditlog \
 -e AUDIT_LEVEL=1 \
 rancher/rancher:stable

This is the end of this article about how to deploy Rancher with Docker (without pitfalls). For more information about deploying Rancher with Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of how to use Docker to deploy a web project and package it into an image file
  • Methods for deploying MySQL services in Docker and the pitfalls encountered
  • Tutorial on deploying Python's Flask framework on Docker
  • How to deploy SpringBoot project using Dockerfile
  • How to deploy nextcloud network disk using docker
  • Detailed explanation of CentOS7 Docker Nginx deployment and operation
  • Installation and deployment of Zabbix based on Docker

<<:  About front-end JavaScript ES6 details

>>:  Deepin20.1 system installs MySQL8.0.23 (super detailed MySQL8 installation tutorial)

Recommend

Detailed explanation of Mencached cache configuration based on Nginx

Introduction Memcached is a distributed caching s...

Should nullable fields in MySQL be set to NULL or NOT NULL?

People who often use MySQL may encounter the foll...

MYSQL string forced conversion method example

Preface Since the types of the same fields in the...

The linkage method between menu and tab of vue+iview

Vue+iview menu and tab linkage I am currently dev...

How to load Flash in HTML (2 implementation methods)

First method : CSS code: Copy code The code is as ...

Detailed explanation of LVM seamless disk horizontal expansion based on Linux

environment name property CPU x5650 Memory 4G dis...

VMware Workstation 12 Pro Linux installation tutorial

This article records the VMware Workstation 12 Pr...

Several ways to center a box in Web development

1. Record several methods of centering the box: 1...

Use of Linux dynamic link library

Compared with ordinary programs, dynamic link lib...

Two types of tab applications in web design

Nowadays, tabs are widely used in web design, but...

CSS--overflow:hidden in project examples

Here are some examples of how I use this property ...

Detailed steps and problem solving methods for installing MySQL 8.0.19 on Linux

I recently bought a Tencent Cloud server and buil...

Analyze several common solutions to MySQL exceptions

Table of contents Preface 1. The database name or...