install-k8s-on-ubuntu-2204/install-containerd.sh
Eliezer Croitoru 4022aafe7c 12
2024-01-28 11:05:27 +00:00

34 lines
845 B
Bash
Executable File

#!/usr/bin/env bash
export DEBIAN_FRONTEND=noninteractive
apt install -y containerd wget
mkdir -p /etc/containerd
containerd config default | tee /etc/containerd/config.toml
sed -i -e "s@SystemdCgroup = false@SystemdCgroup = true@g" \
/etc/containerd/config.toml
echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/010-k8s.conf
echo "br_netfilter" > /etc/modules-load.d/k8s.conf
sysctl --system
modprobe br_netfilter
systemctl restart containerd
cat <<EOF >/etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
EOF
VERSION="v1.28.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
rm -f "crictl-$VERSION-linux-amd64.tar.gz"
crictl ps