$ 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)