K3s搭建
sudo cp k3s /usr/local/bin/k3s
sudo mkdir -p /var/lib/rancher/k3s/agent/images/
sudo cp k3s-airgap-images-amd64.tar /var/lib/rancher/k3s/agent/images/
以上都是为运行install.sh脚本所做的准备工作。
加入containerd
创建containerd的配置文件路径及文件 config.toml.tmpl
sudo mkdir -p /var/lib/rancher/k3s/agent/etc/containerd
sudo vi /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl
文件内容如下
[plugins.opt]
path = "{{ .NodeConfig.Containerd.Opt }}"
[plugins.cri]
stream_server_address = "{{ .NodeConfig.AgentConfig.NodeName }}"
stream_server_port = "10011"
[plugins.cri.cni]
bin_dir = "{{ .NodeConfig.AgentConfig.CNIBinDir }}"
conf_dir = "{{ .NodeConfig.AgentConfig.CNIConfDir }}"
[plugins.cri.containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins.cri.registry.mirrors]
[plugins.cri.registry.mirrors."docker.io"]
endpoint = ["https://registry-1.docker.io"]
[plugins.cri.registry.mirrors."镜像仓库地址"]
endpoint = ["http://镜像仓库地址"]