1、从github下载下来containerd

https://github.com/containerd/containerd/releases/tag/v1.6.8

 

2、解压并将文件直接复制进去/usr/local/bin/

tar xvf containerd-1.6.8-linux-amd64.tar.gz
cp bin/* /usr/local/bin/

 

3、添加containerd.service放进去/lib/systemd/system

 

[root@localhost ~]# cat /lib/systemd/system/containerd.service
# Copyright The containerd Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

[Unit]
Description=containerd container runtime
Documentation=https://containerd.io
After=network.target local-fs.target

[Service]
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/containerd


Type=notify
Delegate=yes
KillMode=process
Restart=always
RestartSec=5
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
LimitNOFILE=infinity
# Comment TasksMax if your systemd version does not supports it.
# Only systemd 226 and above support this version.
TasksMax=infinity
OOMScoreAdjust=-999

[Install]
WantedBy=multi-user.target

 

 

4、创建并且修改配置文件

[root@localhost ~]# mkdir /etc/containerd
[root@localhost ~]# containerd config default >/etc/containerd/config.toml
配置镜像加速及修改sandbox:
vim /etc/containerd/config.toml
 61     sandbox_image = "registry.aliyuncs.com/google_containers/pause:3.7”
153       [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
154         [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
155            endpoint = ["https://9916w1ow.mirror.aliyuncs.com"]

 

5、启动并设置为开机自启动

[root@localhost ~]# systemctl restart containerd
[root@localhost ~]# systemctl enable containerd
[root@localhost ~]# systemctl status containerd

 

6、部署runc

https://github.com/opencontainers/runc找到下面的包下载

wget https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64

 

 

7、使用kubeadm安装k8s

 

从阿里镜像库https://developer.aliyun.com/mirror/进去这里找到kubernetesyum

[root@localhost ~]yum install -y kubelet kubeadm kubectl

调整内核参数:
[root@localhost ~]echo “net.bridge.bridge-nf-call-iptables = 1“ >>/etc/sysctl.conf
[root@localhost ~]echo “net.ipv4.ip_forward = 1 >>/etc/sysctl.conf


执行kubeadm
kubeadm init --apiserver-advertise-address=10.0.0.80 --apiserver-bind-port=6443 --kubernetes-version=v1.25.2 --pod-network-cidr=172.31.0.0/16 --service-cidr=172.32.0.0/16 --service-dns-domain=cluster.local --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --ignore-preflight-errors=swap


当出现成功安装后根据相应的指令执行即可
 [root@localhost ~]mkdir -p $HOME/.kube
[root@localhost ~]sudo cp -i /etc/kubernetes/admin.conf [root@localhost ~]$HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

 

8、安装CNI后即可完成

https://github.com/containernetworking/plugins/releases/tag/v1.1.1

[root@localhost src]wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz
[root@localhost src]# mkdir /opt/cni/bin/ -p
[root@localhost src]# tar xvf cni-plugins-linux-amd64-v1.1.1.tgz -C /opt/cni/bin/

 

原文地址:http://www.cnblogs.com/liangdx0729/p/16883936.html

1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长! 2. 分享目的仅供大家学习和交流,请务用于商业用途! 3. 如果你也有好源码或者教程,可以到用户中心发布,分享有积分奖励和额外收入! 4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解! 5. 如有链接无法下载、失效或广告,请联系管理员处理! 6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需! 7. 如遇到加密压缩包,默认解压密码为"gltf",如遇到无法解压的请联系管理员! 8. 因为资源和程序源码均为可复制品,所以不支持任何理由的退款兑现,请斟酌后支付下载 声明:如果标题没有注明"已测试"或者"测试可用"等字样的资源源码均未经过站长测试.特别注意没有标注的源码不保证任何可用性