Page MenuHomePhabricator

How important the CNI configuration in a single node Microk8s cluster with Containerd
Closed, ResolvedPublic

Description

$ go get github.com/containernetworking/plugins
$ pushd $GOPATH/src/github.com/containernetworking/plugins
$ ./build_linux.sh
$ sudo mkdir /opt/cni
$ sudo cp -r bin /opt/cni/
$ popd

Put the CNI configuration as /etc/cni/net.d/10-mynet.conf:

{
	"cniVersion": "0.2.0",
	"name": "mynet",
	"type": "bridge",
	"bridge": "cni0",
	"isGateway": true,
	"ipMasq": true,
	"ipam": {
		"type": "host-local",
		"subnet": "172.19.0.0/24",
		"routes": [
			{ "dst": "0.0.0.0/0" }
		]
	}
}


[plugins.cri.cni]
    # conf_dir is the directory in which the admin places a CNI conf.
    conf_dir = "/etc/cni/net.d"





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

sudo modprobe overlay
sudo modprobe br_netfilter

# Setup required sysctl params, these persist across reboots.
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables  = 1
net.ipv4.ip_forward                 = 1
net.bridge.bridge-nf-call-ip6tables = 1
EOF

# Apply sysctl params without reboot
sudo sysctl --system

Second Question

Also is this the right way of restarting the containerd deamon which is installed via snap microk8s

sudo systemctl restart snap.microk8s.daemon-containerd.service (snap installed microk8s)

if we install contained externally then (sudo systemctl restart containerd)

Event Timeline

s669m triaged this task as High priority.Jun 24 2021, 9:09 AM
s669m created this task.
s669m renamed this task from How important the CNI configuration in a single node Microk8s cluster to How important the CNI configuration in a single node Microk8s cluster with Containerd.Jun 24 2021, 9:15 AM
s669m lowered the priority of this task from High to Normal.
s669m updated the task description. (Show Details)
schererj claimed this task.