Skip to content

k3s

install

curl -sfL https://get.k3s.io | sh -
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -

--system-default-registry 192.168.3.12:5008

Q&A

  • FATA[0000] failed to setup UID/GID map: newuidmap 2192838 [0 1000 1 1 100000 65536] failed: : exec: "newuidmap": executable file not found in $PATH
sudo apt-get install uidmap

nodes

add node

cat /var/lib/rancher/k3s/server/node-token


curl -sfL https://get.k3s.io | K3S_URL=https://<MASTER_IP>:6443 K3S_TOKEN=<TOKEN> sh -s - --node-name=<NODE_NAME>

kubectl label node <NODE_NAME> node-role.kubernetes.io/worker=worker


* ​​kubectl配置未更新​​,仍然指向 127.0.0.1
kubectl config view | grep server


systemctl edit k3s-agent