Skip to content

Instantly share code, notes, and snippets.

@oglok
Created May 4, 2022 16:18
Show Gist options
  • Save oglok/5251e61106c9958e8cbc5effa3b2baf6 to your computer and use it in GitHub Desktop.
Save oglok/5251e61106c9958e8cbc5effa3b2baf6 to your computer and use it in GitHub Desktop.
MicroShift with Containerd
First of all remove CRIO (if installed) and install Containerd:
sudo dnf remove crio
sudo dnf install containerd
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd
sudo systemctl status containerd
Install CNI plugins:
wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz
mkdir -p /opt/cni/bin
tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.1.1.tgz
sudo systemctl restart containerd
You need to apply this patch to MicroShift project:
diff --git a/pkg/node/kubelet.go b/pkg/node/kubelet.go
index 5598c2f0..a13ca2eb 100644
--- a/pkg/node/kubelet.go
+++ b/pkg/node/kubelet.go
@@ -75,10 +75,9 @@ func (s *KubeletServer) configure(cfg *config.MicroshiftConfig) {
cleanFlagSet.SetNormalizeFunc(cliflag.WordSepNormalizeFunc)
kubeletFlags := kubeletoptions.NewKubeletFlags()
- kubeletFlags.RuntimeCgroups = "/system.slice/crio.service"
kubeletFlags.NodeIP = cfg.NodeIP
kubeletFlags.ContainerRuntime = "remote"
- kubeletFlags.RemoteRuntimeEndpoint = "unix:///var/run/crio/crio.sock"
+ kubeletFlags.RemoteRuntimeEndpoint = "unix:///run/containerd/containerd.sock"
kubeletConfig, err := loadConfigFile(cfg.DataDir + "/resources/kubelet/config/config.yaml")
Let's compile MicroShift:
make build
Now run MicroShift:
sudo ./microshift run 2>&1 | tee logs.txt
From another terminal (I did this as root):
export KUBECONFIG=/var/lib/microshift/resources/kubeadmin/kubeconfig
oc get pods -A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment