离线安装:
下载k3s: curl -o k3s https://github.com/k3s-io/k3s/releases/download/v1.18.16%2Bk3s1/k3s (k3s版本是:v1.18.16)
下载k3s安装脚本: curl -o k3s.sh https://get.k3s.io (原始安装脚本:https://get.k3s.io)
将k3s安装脚本放在任意位置,k3s二进制文件拷贝到目标主机的/usr/local/bin目录:cp k3s /usr/local/bin/
给k3s加上可执行权限:
chmod +x /usr/local/bin/k3s
设置环境变量,跳过下载:
export INSTALL_K3S_SKIP_DOWNLOAD=true
安装:
sh k3s.sh
cat k3s.sh | INSTALL_K3S_EXEC="
crictl模拟docker命令
alias docker='k3s crictl'
验证:kubectl get services 。显示kubernetes服务。
从 server 节点卸载 K3s,请运行:
/usr/local/bin/k3s-uninstall.sh
从 agent 节点卸载 K3s,请运行:
/usr/local/bin/k3s-agent-uninstall.sh
安装docker
yum install -y yum-utils
yum-config-manager
yum makecache fast
yum list docker-ce
yum install -y docker-ce-19.03.8-3.el7
systemctl start docker
systemctl enable docker