Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change default container runtime from docker to containerd #13255

Closed
afbjorklund opened this issue Dec 28, 2021 · 5 comments
Closed

Change default container runtime from docker to containerd #13255

afbjorklund opened this issue Dec 28, 2021 · 5 comments
Labels
co/runtime/containerd co/runtime/docker Issues specific to a docker runtime kind/feature Categorizes issue or PR as related to a new feature.

Comments

@afbjorklund
Copy link
Collaborator

afbjorklund commented Dec 28, 2021

This is a part of #13250, which makes the runtime dynamic

Since Kubernetes is only tested using the "containerd" runtime, it makes sense for minikube to default to using this runtime.

It is also possible to use the "docker" runtime or the "crio" runtimes, but these are not tested by Kubernetes before release.

So the suggestion is to change the new default, for k8s 1.24


This is a more specific change than the old "MEP" proposal

It is already a part of the PR, but noted here for reference...

// defaultRuntime returns the default container runtime
func defaultRuntime(k8sVersion string) string {
       // minikube default
       return constants.Docker
}
// defaultRuntime returns the default container runtime
func defaultRuntime(k8sVersion string) string {
	version, _ := util.ParseKubernetesVersion(k8sVersion)
	// since dockershim removal, only containerd is tested
	if version.GTE(semver.MustParse("1.24.0-alpha.1")) {
		return constants.Containerd
	}
	// default dockershim
	return constants.Docker
}

But it doesn't have to be tied to the dockershim removal at all.

It could be changed for k8s 1.23 too, or it could wait until k8s 1.25 ?

@afbjorklund afbjorklund added kind/feature Categorizes issue or PR as related to a new feature. co/runtime/docker Issues specific to a docker runtime triage/discuss Items for discussion co/runtime/containerd labels Dec 28, 2021
@afbjorklund
Copy link
Collaborator Author

This change is being pushed by upstream, while blaming dockershim:

We have already seen some breakage, due to Docker not being tested:

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

Note that versions before Kubernetes 1.24 will still default to dockershim.

And that versions after Kubernetes 1.24 can still choose to use Docker (opt-in).

		sp := c.Socket // InternalDockerCRISocket
		cs := ""
		// There is no more dockershim socket, in Kubernetes version 1.24 and beyond
		if sp == "" && c.KubernetesVersion.GTE(semver.MustParse("1.24.0-alpha.1")) {
			sp = ExternalDockerCRISocket
			cs = "cri-docker.socket"
		}

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

Maybe obvious, but moving to containerd breaks any "Docker Desktop" dreams.

The user can use nerdctl which is similar-but-not-same, just like podman for crio.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jan 4, 2022

Looks like Docker will still be a supported and tested container runtime, after all.

It might even get automatically detected by kubeadm, even if that is "deprecated".

https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/runtime/runtime.go

		"unix:///run/containerd/containerd.sock",
		"unix:///var/run/crio/crio.sock",
		"unix:///var/run/cri-dockerd.sock",

@afbjorklund afbjorklund removed the triage/discuss Items for discussion label Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/runtime/containerd co/runtime/docker Issues specific to a docker runtime kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

1 participant