cri-o的安装
CRI-O是一个为容器运行时提供轻量级、高效和符合标准的解决方案的开源项目。它是Kubernetes使用的容器运行时接口(CRI)规范的实现之一。
安装
1.关闭防火墙等
#!/bin/bash
systemctl stop firewalld systemctl disable firewalld
setenforce 0 sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
swapoff -a yes | cp /etc/fstab /etc/fstab_bak cat /etc/fstab_bak |grep -v swap > /etc/fstab
sed -i "s#^net.ipv4.ip_forward.*#net.ipv4.ip_forward=1#g" /etc/sysctl.conf sed -i "s#^net.bridge.bridge-nf-call-ip6tables.*#net.bridge.bridge-nf-call-ip6tables=1#g" /etc/sysctl.conf sed -i "s#^net.bridge.bridge-nf-call-iptables.*#net.bridge.bridge-nf-call-iptables=1#g" /etc/sysctl.conf
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf echo "net.bridge.bridge-nf-call-ip6tables = 1" >> /etc/sysctl.conf echo "net.bridge.bridge-nf-call-iptables = 1" >> /etc/sysctl.conf
sysctl -p
systemctl enable kubelet systemctl start kubelet
|
2.安装CRI-O
Centos_7:
export VERSION=1.28 sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/CentOS_7/devel:kubic:libcontainers:stable.repo sudo curl -L -o /etc/yum.repos.d/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:${VERSION}/CentOS_7/devel:kubic:libcontainers:stable:cri-o:${VERSION}.repo
yum install -y cri-o
|
部署K8s集群
修改配置文件
vim /etc/crio/crio.conf pause_image = "registry.aliyuncs.com/google_containers/pause:3.1"
kubeadm init --pod-network-cidr=<192.168.0.0/16> --apiserver-advertise-address=<10.10.101.123> --image-repository registry.aliyuncs.com/google_containers --service-cidr=<10.96.0.0/12> --kubernetes-version=<v1.25.14> --cri-socket=unix:///var/run/crio/crio.sock
|