Menu Close

Setup k3s on CentOS 7


# 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

replace the ip address to your rancher server ip.

# actual install
curl -sfL | 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 | K3S_KUBECONFIG_MODE="644" sh -s

# get token
sudo cat /var/lib/rancher/k3s/server/node-token

# setup worker
curl -sfL | K3S_URL="" K3S_TOKEN="<token>" K3S_NODE_NAME="<node name>" sh -

Leave a Reply

Your email address will not be published. Required fields are marked *