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 three ways to set borders in HTML

Three ways to set borders in HTML border-width: 1...

Vue realizes price calendar effect

This article example shares the specific code of ...

HTML imitates Baidu Encyclopedia navigation drop-down menu function

HTML imitates the Baidu Encyclopedia navigation d...

How to create LVM for XFS file system in Ubuntu

Preface lvm (Logical Volume Manager) logical volu...

Detailed tutorial on installing the jenkins container in a docker environment

Recommended Docker learning materials: https://ww...

Handtrack.js library for real-time monitoring of hand movements (recommended)

【Introduction】: Handtrack.js is a prototype libra...

Use CSS variables to achieve cool and amazing floating effects

Recently, I found a fun hover animation from the ...

JavaScript Regular Expressions Explained

Table of contents 1. Regular expression creation ...

How to deploy Vue project under nginx

Today I will use the server nginx, and I also nee...

How to install Elasticsearch7.6 cluster in docker and set password

Table of contents Some basic configuration About ...

MySQL database constraints and data table design principles

Table of contents 1. Database constraints 1.1 Int...

Detailed explanation of the use of filter properties in CSS

The filter attribute defines the visual effect of...

jQuery implements sliding tab

This article example shares the specific code of ...