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

Make default container runtime dynamic #13250

Closed
afbjorklund opened this issue Dec 28, 2021 · 2 comments · Fixed by #13251
Closed

Make default container runtime dynamic #13250

afbjorklund opened this issue Dec 28, 2021 · 2 comments · Fixed by #13251
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@afbjorklund
Copy link
Collaborator

afbjorklund commented Dec 28, 2021

Since Kubernetes 1.24, there is no longer a "default" container runtime (since the removal of dockershim).

Instead, the user will have to supply a container runtime. But the only tested container runtime is containerd.


The current constant should be converted, into a default placeholder - which translates into a dynamic value

        // Containerd is the default name and spelling for the containerd container runtime
        Containerd = "containerd"
        // CRIO is the default name and spelling for the cri-o container runtime
        CRIO = "crio"
        // DefaultContainerRuntime is our default container runtime
        DefaultContainerRuntime = "docker"

A new constant Docker should be introduced instead, to replace all the hardcoded "docker" strings...

User can still choose it as the container runtime (no matter the default), using --container-runtime=docker.

Minikube should still provide a default container runtime for each k8s version, even if Kubernetes does not.

--container-runtime='': The container runtime to be used. Valid options: docker, cri-o, containerd (default: auto)

https://kubernetes.io/docs/setup/production-environment/container-runtimes/

Items on this page refer to third party products or projects that provide functionality required by Kubernetes.
The Kubernetes project authors aren't responsible for those third-party products or projects.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

Suggested change:

        // Containerd is the default name and spelling for the containerd container runtime
        Containerd = "containerd"
        // CRIO is the default name and spelling for the cri-o container runtime
        CRIO = "crio"
        // Docker is the default name and spelling for the docker container runtime
        Docker = "docker"
        // DefaultContainerRuntime is our default container runtime
        DefaultContainerRuntime = ""

Then there needs to be code handling this, currently there's a truckload of viper.GetString(containerRuntime)

In the future, the value will needs to be converted into an actual runtime and the default computed by k8s version.

@afbjorklund afbjorklund added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 28, 2021
@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Dec 28, 2021

Note that you can still use docker or crio, they are just not getting tested upstream (but with Mirantis or with OpenShift)

container runtime container engine CRI Socket
"containerd" nerdctl (cri-containerd)
containerd (with cri plugin)
unix:///run/containerd/containerd.sock
"docker" docker cri-dockerd
(dockershim)
unix:///var/run/cri-docker.sock (1.24-)
unix:///var/run/dockershim.sock (-1.23)
"crio" podman cri-o (one version per k8s) unix:///var/run/crio/crio.sock

Contrary to popular belief, the removal of dockershim is not the same as the removal of docker. Just enforcing an API...

Starting with Kubernetes 1.24, the old Docker-specific hacks have been removed from the codebase. Instead use CRI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant