Rancher installation (k8s)

1. Rancher Overview

Rancher official documentation
Rancher is a Kubernetes management tool that allows you to deploy and run clusters anywhere and on any provider.

Rancher can create a cluster from a Kubernetes hosting provider, create nodes and install Kubernetes, or import an existing Kubernetes cluster running anywhere.

Rancher adds new features based on Kubernetes, including unifying authentication and RBAC across all clusters, allowing system administrators to control access to all clusters from one location.

In addition, Rancher can provide more granular monitoring and alerting for clusters and resources, send logs to external providers, and integrate Helm directly through the application store (Application Catalog). If you have an external CI/CD system, you can connect it to Rancher. If not, you can also use Fleet provided by Rancher to automatically deploy and upgrade workloads.

Rancher is a full-stack Kubernetes container management platform that provides you with the tools to successfully run Kubernetes anywhere.

2 Install Rancher


2.2.1 Close the swap partition

sudo swapoff -a

verify

free -m

2.2.2 Make sure the time zone and time are correct
sudo timedatectl

2.2.3 Make sure the virtual machine will not automatically suspend
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

2.2.4 Load the kernel module br_netfilter and adjust it Parameter
execution

sudo modprobe br_netfilter

confirms loading

lsmod | grep br_netfilter 

adjusts the kernel parameters and modifies /etc/sysctl.conf
to pass the bridged IPv4 traffic to the iptables chain

vim /etc/sysctl.conf

cat > /etc/sysctl.conf << EFO
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EFO

makes the configuration effective, execute :

sudo sysctl --system

2.2.5 Set the value of rp_filter
and execute

sudo vi /etc/sysctl.d/10-network-security.conf
1
Change the values ​​of the following two parameters in the file from 2 to 1

net.ipv4.conf.default.rp_filter=1 
net.ipv4.conf.all.rp_filter=1

to make the configuration take effect, execute:

sudo sysctl --system

2.3 Start Rancher

2.3.1 Start Rancher

You need to add the --privileged parameter when starting

sudo docker run -d --restart=unless-stopped --privileged --name rancher -p 20080:80 -p 443:443 rancher/rancher

2.3.2 Log in through the web interface

Address: https:// + ip

If you set your own boot password beforehand, enter it here. Otherwise a random one will be generated for you.
Use docker ps to find your container ID, then run:

sudo docker logs container-id 2>&1 | grep "Bootstrap Password:"

 

 

Guess you like

Origin blog.csdn.net/qq_41118173/article/details/131182442