kinvolk / lokomotive

🪦 DISCONTINUED Further Lokomotive development has been discontinued. Lokomotive is a 100% open-source, easy to use and secure Kubernetes distribution from the volks at Kinvolk
https://kinvolk.io/lokomotive-kubernetes/
Apache License 2.0
321 stars 49 forks source link

Prepare to use CRI instead of built-in dockershim #1058

Open rata opened 4 years ago

rata commented 4 years ago

Kubernetes uses the Container Runtime Interface, created by Kubernetes, to communicate with the container runtime. Docker doesn't provide a way to interact with the CRI and support is built into the kubelet to do that. It is called dockershim

Kubernetes will add a warning about dockershim being deprecated in Kubernetes 1.20: https://github.com/kubernetes/enhancements/pull/1985. However, as you can see in that KEP, there is no migration guide created yet and is not clear if dockershim will be maintainer by others out of the Kubelet or not. Of course, the CRI interface is alpha too :joy:. The target is not really close nor too far away: Kubernetes 1.21 (https://github.com/kubernetes/enhancements/pull/1985/files#diff-8368b5d11d71e49cc6ca0e6289548c45R143-R146)

There are several options (like use containerd that supports the CRI as a plugin), but we should take into account:

  1. The CRI interface is alpha (will be moved to beta soon) and as it isn't user visible, breaking changes can happen even in Beta IIUC.
  2. We will need to choose if we want docker or other container runtime and how to update it. Docker is shipped with Flatcar, so it is automatically updated too.

More info regarding 1:

More info regarding 2:

EDIT: Just to be clear, I guess this is an issue until the CRI is GA (or tools supports more than one interface). My guess is that once CRI is GA, this won't be an issue anymore. Therefore, another way to look into this is: see how to smartly workaround the problems that arise until the interface is stable and all is solved :)

invidian commented 4 years ago

containerd is close to be usable on Flatcar (https://github.com/flatcar-linux/Flatcar/issues/201) and it provides CNI, though not out of the box (needs to be configured). We could use it instead of Docker. I tried it on Ubuntu and it worked fine.

rata commented 4 years ago

@invidian does that solve/helps with the upgrade/downgrade part? I don't know enough about torcx :)

rata commented 3 years ago

CRI change might take longer: https://github.com/kubernetes/kubernetes/pull/96325#issuecomment-724899472. Seems kubelet will continue to support one interface, runtimes might support more than one if they want (that would be SUPER helpful for us :)).

This change also was merged for 1.20: https://github.com/kubernetes/kubernetes/commit/9fcede9d5b37fccfe3269bd93559c551e47de5ff