-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
none with containerd: make it possible to run without the docker
CLI
#10908
Comments
It's a bug, unfortunately: #5549 It should not look for "docker", when wanting to run with containerd.
Docker is still the default runtime, though. |
@afbjorklund I like to work on this |
Please do, note that it is not the warning and the early exit that is the real issue here. if _, err := exec.LookPath("docker"); err != nil {
return registry.State{Running: true, Error: err, Installed: false, Fix: "Install docker", Doc: "https://minikube.sigs.k8s.io/docs/reference/drivers/none/"}
} So just comment that out while debugging. We also have some callouts to the Docker daemon, but those should just fail (for now) (the other is #8577) |
/assign tharun208 |
docker
command
I haven't looked at the none driver recently, but if it isn't possible to simply remove the |
docker
commanddocker
CLI
@tstromberg I'm aware of nerdctl(my friend made it), but I just wanted to setup kubernetes with local runtime without using kubeadm easily. So using nerdctl is not really an option for my use-case |
As far as I know, the "docker" issues are because the minikube driver registry is broken Not because the Docker client is actually required for anything (beyond e.g. docker-env) You will have to install |
@tharun208 are you still interested in working on this? if so, reassign yourself. Help wanted! |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
You can simply spoof it with a docker binary in path that does nothing. sudo printf "#!/usr/bin/env bash\nexit 0" > /usr/local/bin/docker && sudo chmod +x /usr/local/bin/docker |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
@tharun208 I haven't heared from u...I will un-assign this issue is available for picking up |
@afbjorklund / @medyagh I want to debug this error to see if I could fix it so we don't need the workaround of:
From TDD perspective where should I create an test on the codebase? Possibly we are talking about an e2e test, I also see there is this PS.: plz go easy on me, I am new to minikube code =p |
The issue is somewhere in the driver registry, for some reason it calls every constructor twice... https://github.com/kubernetes/minikube/tree/master/pkg/minikube/registry |
One thing that is confusing to me is that docker/podman are "--driver" options as well as "--container-runtime"s. This is not consistent with containerd. Maybe the logic of the code requires the creation of another driver option for containerd? Or else Podman and Docker should also use driver None. https://github.com/kubernetes/minikube/blob/master/pkg/minikube/registry/global.go#L29 -> see IsKIC logic for example. Am I missing something to understand? It is also not clear to me how these Kong Ingress Controller addons play a role in firing the runtime in K8s. |
@staticdev : we are running docker-in-docker, or crio-in-podman. So yes, it is confusing with the "driver" and "runtime".
But I think the docker "requirement" comes from the none driver, and not from the container runtime. IIRC.
|
So it is supposed to look in the registry for "none", func status() (retState registry.State) {
_, err := exec.LookPath(oci.Docker)
if err != nil {
return registry.State{Error: err, Installed: false, Healthy: false, Fix: "Install Docker", Doc: docURL}
} I think it is currently explicitly coded in both, but still broken even without it. func status() registry.State {
_, err := exec.LookPath("iptables")
if err != nil {
return registry.State{Running: true, Error: err, Fix: "iptables must be installed", Doc: "https://minikube.sigs.k8s.io/docs/reference/drivers/no
ne/"}
}
if _, err := exec.LookPath("docker"); err != nil {
return registry.State{Running: true, Error: err, Installed: false, Fix: "Install docker", Doc: "https://minikube.sigs.k8s.io/docs/reference/driv
ers/none/"}
} Here is the libmachine error:
https://github.com/kubernetes/minikube/blob/master/pkg/drivers/none/none.go#L82 So that's the part where it is using the wrong runtime (cruntime.Manager), docker instead of containerd. If I remember correctly, it was due to "ContainerRuntime" being reset to the empty string somewhere ? |
@afbjorklund after digging a bit more I think the solution is to remove this docker check anyway since it is redundant with runtime available method for docker here https://github.com/kubernetes/minikube/blob/master/pkg/drivers/none/none.go#L82 The other path to call docker validation with though registry/global.go on L149 that calls
This ALWAYS checks if you have docker, independently of container runtime. This validation is completely unnecessary and redundant since runtime already does the same check. I created a PR to remove it. |
UPDATE: Still after removing the docker validation from
After some debugging I see on precreate that the driver is wrongly being assigned to docker runtime instead of containerd. There reason for that is that the driver is created correctly the first time here with Then, it is validated and for some reason, the driver is recreated (not sure if it is necessary) on When you create a none driver, you run func Not sure how to improve here... options:
Both options will break the API by changing the signature of |
Might be worth mentioning the workaround sudo printf "#!/usr/bin/env bash\nexit 0" > /usr/local/bin/docker && sudo chmod +x /usr/local/bin/docker Doesn't resolve the failure during [example@localhost ~]$ minikube delete --purge
:arrows_counterclockwise: Uninstalling Kubernetes v1.25.2 using kubeadm ...
:fire: Deleting "minikube" in none ...
:x: Failed to delete cluster: host remove retry: kill: containers: docker: docker ps -a --filter=name=k8s_ --format={{.ID}}: exit status 125
stdout: |
like @lucastheisen states, the work around has a failure on delete because of the filter looking for an underscore, where containerd uses 'k8s://' to prefix containers.... so, please let me know if this might be another workaround?
I had already made a bash_alias for nerdctl over docker, so I just made a shell script to modify the filter to also optionally do the containerd format. It did result in a successful stop:
(and a successful start) |
Steps to reproduce the issue:
This is the current behavior regarding initizliation with none driver with containerd runtime.
Since Docker is no longer default runtime, I think even none driver should consider the runtime option if specified.
Full output of failed command:
Full output of
minikube start
command used, if not already included:Optional: Full output of
minikube logs
command:The text was updated successfully, but these errors were encountered: