首页 > 其他分享 >升级k8s版本废弃docker引擎

升级k8s版本废弃docker引擎

时间:2023-11-08 17:45:39浏览次数:35  
标签:cri grpc containerd crictl io docker k8s 废弃 registry

1、废弃docker引擎

systemctl enable kubelet
systemctl enable containerd

cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF

cat /etc/modules-load.d/k8s.conf 

modprobe overlay
modprobe br_netfilter

mv /etc/sysctl.d/k8s.conf /etc/sysctl.d/k8s.conf-bak

cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-iptables  = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.ipv4.ip_forward                 = 1
EOF

cat /etc/sysctl.d/k8s.conf

sysctl --system
lsmod | grep br_netfilter
lsmod | grep overlay

sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward

cd /etc/containerd/
mv config.toml  config.toml-bak
containerd config default > /etc/containerd/config.toml
ls 

vim /etc/containerd/config.toml
2 root = "/data/containerd"
57     sandbox_image = "fat.harbor.bjshxg.com/kubernetes/pause:3.6"

102     [plugins."io.containerd.grpc.v1.cri".registry]
103       [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
104         [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
105           endpoint = ["https://registry-1.docker.io"]
106         [plugins."io.containerd.grpc.v1.cri".registry.mirrors."fat.harbor.bjshxg.com"]
107           endpoint = ["http://fat.harbor.bjshxg.com"]
108         [plugins."io.containerd.grpc.v1.cri".registry.mirrors."skg.harbor.bjshxg.com"]
109           endpoint = ["http://skg.harbor.bjshxg.com"]
110       [plugins."io.containerd.grpc.v1.cri".registry.configs]
111         [plugins."io.containerd.grpc.v1.cri".registry.configs."fat.harbor.bjshxg.com".tls]
112           insecure_skip_verify = true
113         [plugins."io.containerd.grpc.v1.cri".registry.configs."fat.harbor.bjshxg.com".auth]
114           username = "admin"
115           password = "K!rOLRknyWxv%P8R"
116         [plugins."io.containerd.grpc.v1.cri".registry.configs."skg.harbor.bjshxg.com".tls]
117           insecure_skip_verify = true
118         [plugins."io.containerd.grpc.v1.cri".registry.configs."skg.harbor.bjshxg.com".auth]
119           username = "admin"
120           password = "K!rOLRknyWxv%P8R"



vim /etc/sysconfig/kubelet
KUBELET_EXTRA_ARGS="--container-runtime=remote --container-runtime-endpoint=unix:///run/containerd/containerd.sock"

mkdir /data/containerd



systemctl daemon-reload
systemctl restart containerd
systemctl restart kubelet

ctr -n=k8s.io image import kube-proxy-v1.23.14.tar
ctr -n=k8s.io image import k8s-v1.23.14.tar

 

2、安装crictl工具

VERSION="v1.22.0"
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-amd64.tar.gz

tar zxvf crictl-$VERSION-linux-amd64.tar.gz -C /usr/local/bin

ls /usr/local/bin/crictl 
ln -sf /usr/local/bin/crictl  /usr/sbin/crictl
ls /usr/sbin/crictl
ln -sf /usr/local/bin/crictl  /usr/bin/crictl
ls /usr/bin/crictl

vim /etc/crictl.yaml
runtime-endpoint: unix:///var/run/containerd/containerd.sock
image-endpoint: unix:///var/run/containerd/containerd.sock
debug: false
pull-image-on-create: false
disable-pull-on-run: false

crictl version
crictl pods


systemctl daemon-reexec
systemctl restart containerd.service

 

标签:cri,grpc,containerd,crictl,io,docker,k8s,废弃,registry
From: https://www.cnblogs.com/linjiangCN/p/17817952.html

相关文章

  • Docker引擎架构
    Docker引擎架构1.Docker引擎的发展1.1Docker引擎首次发布时Docker首次发布时,Docker引擎由两个核心组件组成:LXC和DockerdaemonDockerdaemon是单一的二进制文件,包含诸如Docker客户端、DockerAPI、容器运行时、镜像构建等。LXC提供对诸如命名空间(Namespace)和控制组(CGroup)......
  • Docker容器间的网络设置
    1、构建自定义docker网络dockernetworkcreate-dbridgedocker_Net#其中,-d指定了docker的网络类型为bridge类型,并自定义docker网络的名称为docker_Net创建成功后,用dockernetworkls查看系统的docker网络: 2、创建docker容器dockerrun-it--rm\--namebusybox_2\......
  • docker日志收集docker插件+loki+grafna
    实现收集docker容器日志方式:dokcer安装插件,将日志发送到loki,grafna展示日志。1、安装lokiwgethttps://raw.githubusercontent.com/grafana/loki/v2.9.1/cmd/loki/loki-local-config.yaml-Oloki-config.yamldockerrun--nameloki-d-v$(pwd):/mnt/config-p3100:3100......
  • 一文带你认识「Docker」与「k8s」
    转载:https://juejin.cn/post/7015729458959089701随着k8s作为容器编排解决方案变得越来越流行,有些人开始拿Docker和k8s进行对比,不禁问道:Docker不香吗?k8s是kubernetes的缩写,'8'代表中间的八个字符。其实Docker和k8s并非直接的竞争对手,它俩相互依存。Docker是......
  • k8s的使用
     apiVersion:v1              #必选,版本号,例如v1kind:Pod                #必选,Podmetadata:                #必选,元数据 name:string           ......
  • k8s 外部ip定义
    apiVersion:v1kind:Servicemetadata:name:xinxi-azure-svcnamespace:jituan-xinxi-bespec:ports:-name:xinxi-azure-portport:443protocol:TCPtargetPort:38455type:ClusterIP---apiVersion:v1kind:Endpointsmeta......
  • CentOS怎么安装最新版本docker
    环境查看[root@localhost~]#cat/etc/redhat-releaseCentOSLinuxrelease7.9.2009(Core)[root@localhost~]#uname-aLinuxlocalhost.localdomain3.10.0-1160.el7.x86_64#1SMPMonOct1916:18:59UTC2020x86_64x86_64x86_64GNU/Linux安装docker#更新源......
  • k8s-服务网格实战-配置 Mesh(灰度发布)
    在上一篇k8s-服务网格实战-入门Istio中分享了如何安装部署Istio,同时可以利用Istio实现gRPC的负载均衡。今天我们更进一步,深入了解使用Istio的功能。从Istio的流量模型中可以看出:Istio支持管理集群的出入口请求(gateway),同时也支持管理集群内的mesh流量,也就是集群内......
  • docker 更新容器镜像
    本文主要记录使用docker-compose的情况下,来更新镜像、以postgres镜像为例✨只会更新image:postgres:latest,末尾为latest标签的容器镜像进入docker-compose目录按顺序执行以下shell命令#更新容器镜像sudodockercomposepull#启动容器docker-composeup-d--re......
  • 一、minikube部署单机k8s环境
    一、minikube部署单机k8s环境注意:此处为方便测试,使用minikube部署单机k8s环境,生产环境请根据实际情况操作1.安装docker-ce依赖安装:yuminstall-yyum-utilsdevice-mapper-persistent-datalvm2wget添加docker软件源:yum-config-manager--add-repohttps://mirrors.aliyun.co......