prerequisite
# change ip and hostname
vi /etc/sysconfig/network-scripts/ifc
vi /etc/hostname
# optional disable firewall
systemctl disable firewalld --now
install rancher
prefer on master node run:
mkdir /etc/rancher/rke2
vi config.yaml
token: somestringforrancher
tls-san:
- 192.168.1.128
replace the ip address to your rancher server ip.
# actual install
curl -sfL https://get.rancher.io | sh -
# enable service
systemctl enable rancherd-server.service
systemctl start rancherd-server.service
# check startup state
journalctl -eu rancherd-server.service -f
# login ui
rancherd reset-admin
Install K3s
# setup master
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s
# get tokensudo cat /var/lib/rancher/k3s/server/
node-token
# setup worker
curl -sfL https://get.k3s.io | K3S_URL="https://192.168.0.29:6443" K3S_TOKEN="<token>" K3S_NODE_NAME="<node name>" sh -