Remove dockershim from crictl#871
Remove dockershim from crictl#871shannonxtreme wants to merge 2 commits intokubernetes-sigs:masterfrom
Conversation
|
Welcome @shannonxtreme! |
|
looks like all the bases are covered. thanks @shannonxtreme /assign @adisky one thing though ... for hack/run-dockershim-critest.sh we could add some comments that i can only work with https://github.com/Mirantis/cri-dockerd and not with any other CRI implementation. (either in this PR or in a follow up, i don't mind) |
|
@dims: GitHub didn't allow me to assign the following users: adisky. Note that only kubernetes-sigs members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Do we want |
One thing is that the matrix is not up to date: https://github.com/kubernetes-sigs/cri-tools#current-status |
@SergeyKanzhelev doesn't users expected to use matching version of crictl & k8s, if K8s 1.24 removed dockershim crictl 1.24 also expected to do the same? possiblty we should release a 1.23 tag for crictl then merge this PR? Also this isn't essentially removing any support, only removing dockershim from default endpoints users can still configure |
1ab9a1a to
d17e653
Compare
as a general statement, this wouldn't be ideal. Since the |
| - `-ginkgo.focus`: Only run the tests that match the regular expression. | ||
| - `-image-endpoint`: Set the endpoint of image service. Same with runtime-endpoint if not specified. | ||
| - `-runtime-endpoint`: Set the endpoint of runtime service. Default to Unix: `unix:///var/run/dockershim.sock` or Windows: `tcp://localhost:3735`. | ||
| - `-runtime-endpoint`: Set the endpoint of runtime service. Default to Unix: `unix:///var/run/containerd.sock` or Windows: `tcp://localhost:3735`. |
There was a problem hiding this comment.
there are three different defaults, maybe need to be mentioned.
There was a problem hiding this comment.
It attempts to connect to each default endpoint in order as well doesn't it? So containerd, cri-o, cri-dockerd?
| - Output the test results to STDOUT | ||
|
|
||
| critest connects to Unix: `unix:///var/run/dockershim.sock` or Windows: `tcp://localhost:3735` by default. For other runtimes, the endpoint can be set by flags `--runtime-endpoint` and `--image-endpoint`. | ||
| critest connects to Unix: `unix:///var/run/containerd.sock` or Windows: `tcp://localhost:3735` by default. For other runtimes, the endpoint can be set by flags `--runtime-endpoint` and `--image-endpoint`. |
There was a problem hiding this comment.
perhaps rephrase to match the warning added here: #599 stating that the endpoint must be specified and that the default is deprecated
710fcfa to
6bdb5c1
Compare
|
Let's discuss the release related bits in #856 |
|
We would have hate having to use different versions of crictl in minikube, for different versions of kubernetes. Removing dockershim support just for the sake of it seems useless (or premature), if it is not there it is not there ? EDIT: Just to be clear, minikube does set up the crictl.yaml. Even for docker, where it not even used or required But still using crictl 1.21 for k8s 1.23, so requiring a closer match would still be a big change compared with today |
This comment has been minimized.
This comment has been minimized.
But then you could remove all endpoints, instead of just one. |
|
I'm not sure why that hasn't happened. Maybe a deprecation policy thing?
I guess a middle ground could be to move dockershim.sock to last on the
list so that it isn't the first endpoint tried by default
…On Thu., Jan. 13, 2022, 16:25 Anders Björklund, ***@***.***> wrote:
Since the defaults are deprecated anyway, isn't this loss of functionality
more of an incentive to move off relying on just the defaults, and instead
specifying explicit endpoints?
But then you could remove all endpoints, instead of just one.
—
Reply to this email directly, view it on GitHub
<#871 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHH4EFWOBNMOIF5BNFD6BJTUV3AEBANCNFSM5LY6AQUA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The majority of users have not even installled (much less configured) these still undocumented debugging tools, since it was not recommended for their runtime. So I guess it made sense to have it try with dockershim, if they dared to install the tool ? But now that is required by all container runtimes, maybe it will end up being documented under "container runtimes" and not just under "node debugging" and it will see some better installations - such as packaging and configuring (setting up crictl.yaml) |
Same thing for minikube, currently using a random version 1.21.0 for the crictl installation in the OS If it will be versioned with kubernetes, we need to move it to runtime bootstrapping installation instead. |
They don't have to "migrate", they just have to start using CRI |
|
Is it that the defaults currently do not work? I thought the case is that
the defaults are deprecated and will be removed at some point, but still
work for now
…On Thu., Jan. 13, 2022, 17:27 Anders Björklund, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In docs/benchmark.md
<#871 (comment)>
:
>
## Additional options
- `-ginkgo.focus`: Only run the tests that match the regular expression.
- `-image-endpoint`: Set the endpoint of image service. Same with runtime-endpoint if not specified.
-- `-runtime-endpoint`: Set the endpoint of runtime service. Default to Unix: `unix:///var/run/dockershim.sock` or Windows: `tcp://localhost:3735`.
+- `-runtime-endpoint`: Set the endpoint of runtime service. Default to Unix: `unix:///var/run/containerd.sock` or Windows: `tcp://localhost:3735`.
there is no default: #597
<#597>
—
Reply to this email directly, view it on GitHub
<#871 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHH4EFXUWCWAMZP76JGPB4DUV3HMHANCNFSM5LY6AQUA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The project doesn't dare to pick a new favorite, so recommends using any container runtime that follows the CRI
And if crictl needs to try all the possible locations, that introduces a latency when checking the various sockets... But checking all 4 locations "works", I thought. |
I meant migrate away from using dockershim. |
|
Currently (v1.24.0), it is just failing. It never gets around to trying It works fine with the $ crictl -r unix:///run/cri-dockerd.sock version
Version: 0.1.0
RuntimeName: docker
RuntimeVersion: 20.10.12
RuntimeApiVersion: 1.41.0 |
|
make a rebase again? |
ok.. thx for the heads up.. need some more debug so we can see which container runtime on which socket doesn't have a matching runtime.v1alpha2.RuntimeService... From your log going to guess you have a very old version of containerd running? or.... see below |
|
It was either 1.4 or 1.5 (whatever docker used), should be easy to reproduce There were some weird ghost reports of it "failing" even with containerd 1.6, since the error message can be misleading if the daemon is not answering/running for some reason... By providing it explicitly, the error is more clear. And by using configuration, it is less cluttered than having to lug that |
If containerd is installed but you have disabled the cri plugin on purpose (standard for docker install's version of the containerd config.toml) the containerd sock will not have any cri services to serve and crictl will see that as a failure. It, crictl, shouldn't stop the loop rather it should continue on reporting that the containerd sock does not have cri enabled and going to the next default runtime in the loop. |
|
The error here https://github.com/kubernetes-sigs/cri-tools/blob/master/cmd/crictl/main.go#L82 isn't very useful when the err returned does not mention the endpoint that failed... |
|
IMO the loop thing should be: .. you don't have a container runtime configured in your crictl config and you have not set one at the command line or in the ENV.. here are your options... we've tried the following container runtimes with at the typical defaults (show the options in the loop and status).. ask which they would like to set as their default in the crictl config...: grab stdin wait for response for 30sec.. no input fail to prompt Or we can fix the somewhat rude disabling of the containerd cri plugin :-) maybe just output the instructions in the error message. "container config default > /etc/containerd/config.toml".. "service containerd restart" Or we can just remove the loop entirely, it's deprecation time has expired? |
|
I tried again, with the latest minikube beta - but with k8s version 1.24.0 and crictl version 1.24.0:
docker@minikube:~$ sudo rm /etc/crictl.yaml
docker@minikube:~$ sudo ./crictl --version
crictl version 1.24.0
docker@minikube:~$ sudo ./crictl version
WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
ERRO[0000] unable to determine runtime API version: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory"
E0525 18:30:45.757607 51352 remote_runtime.go:168] "Version from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
FATA[0000] getting the runtime version: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService
docker@minikube:~$ containerd --version
containerd containerd.io 1.6.4 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
docker@minikube:~$ dockerd --version
Docker version 20.10.15, build 4433bf6
docker@minikube:~$ cri-dockerd --version
cri-dockerd 0.2.0 (a4d1895)
docker@minikube:~$ sudo ./crictl -r unix:///var/run/cri-dockerd.sock version
Version: 0.1.0
RuntimeName: docker
RuntimeVersion: 20.10.15
RuntimeApiVersion: 1.41.0So we always set up the /etc/crictl.yaml config. |
c5fa7c7 to
4347784
Compare
|
Ok so I rebased, but I'd really like someone to take another look at these changes to make sure this is right |
you may have tried it again but did you fix the broken config.toml yet and restart containerd? |
|
It using docker, not containerd The config is not broken, it just doesn't need the cri plugin (since that is handled by cri dockerd) Even if so, it would be better to clear the config than to copy an old default config (to be obsoleted)
|
|
Here is the output from the version in this PR: docker@minikube:~$ sudo ./crictl --version
crictl version 1.24.0-38-g43477844
docker@minikube:~$ sudo ./crictl --debug version
DEBU[0000] get runtime connection
WARN[0000] runtime connect using default endpoints: [unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock unix:///var/run/dockershim.sock]. As the default settings are now deprecated, you should set the endpoint instead.
DEBU[0000] Note that performance maybe affected as each default connection attempt takes n-seconds to complete before timing out and going to the next in sequence.
DEBU[0000] Connect using endpoint "unix:///run/containerd/containerd.sock" with "2s" timeout
DEBU[0000] Connected successfully using endpoint: unix:///run/containerd/containerd.sock
DEBU[0000] VersionRequest: &VersionRequest{Version:v1,}
E0526 10:31:27.234639 568 remote_runtime.go:168] "Version from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
DEBU[0000] VersionResponse: nil
FATA[0000] getting the runtime version: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService
docker@minikube:~$ It never tries the other endpoints. If I enable the cri plugin, then it will think that it should use the containerd runtime (instead of the docker runtime) root@minikube:/home/docker# containerd config default > /etc/containerd/config.toml
root@minikube:/home/docker# systemctl restart containerd
root@minikube:/home/docker# exit
exit
docker@minikube:~$ sudo ./crictl --debug version
DEBU[0000] get runtime connection
WARN[0000] runtime connect using default endpoints: [unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock unix:///var/run/dockershim.sock]. As the default settings are now deprecated, you should set the endpoint instead.
DEBU[0000] Note that performance maybe affected as each default connection attempt takes n-seconds to complete before timing out and going to the next in sequence.
DEBU[0000] Connect using endpoint "unix:///run/containerd/containerd.sock" with "2s" timeout
DEBU[0000] Connected successfully using endpoint: unix:///run/containerd/containerd.sock
DEBU[0000] VersionRequest: &VersionRequest{Version:v1,}
DEBU[0000] VersionResponse: &VersionResponse{Version:0.1.0,RuntimeName:containerd,RuntimeVersion:1.6.4,RuntimeApiVersion:v1,}
Version: 0.1.0
RuntimeName: containerd
RuntimeVersion: 1.6.4
RuntimeApiVersion: v1So then it won't match the CRI configuration from kubeadm, which will confuse things later.
(the last kubelet argument doesn't actually do anything now, but is a different issue than crictl)
So I think it is better to leave the default docker configuration for containerd, and configure crictl ? /etc/containerd/config.toml /etc/crictl.yaml |
correct if docker's edit of the containerd config has disabled the cri services the containerd sock won't serve cri services, not moving on seems like a bug in crictl
this is your view.. makes sense to you.. may not make sense to people who are not using a dockershim version of kubelet on their workernode or development environment crictl has a config option and a cli option to let users specify which container runtime they want to use for ages the defaulting sequence list in crictl was dockershim first and the list was deprecated .. I believe with the intention of removing it and letting people choose manually via config or cli.. given the number of options available for choosing it makes sense to let users choose which container runtime they want. choices: either delete the default code and force manual config, or keep it as it is with a fix to continue to the next when the sock is there but docker has disabled the cri api, or get docker to stop disabling the cri api in containerd, and/or give crictl users a list to choose from and ask them which one they want..
why does kubeadm require containerd not be configured correctly for working with kubeadm? I believe kubeadm also works with containerd/cri-o?
it is better to have containerd, and the other container runtimes, configured correctly for their clients, and configure crictl for your specific use case. There are a great number of clients of the container runtimes... not just this particular kubeadm use case.
yup and or |
And currently it is broken, ever since cri-dockerd.sock was moved to the end of the deprecated list.
It uses a separate flag / config item for kubeadm, and then uses |
|
@shannonxtreme: PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
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 |
|
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 |
|
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
|
@k8s-triage-robot: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind feature
/kind deprecation
What this PR does / why we need it:
Removes dockershim from the crictl docs and main_unix / main_windows in preparation for the 1.24 deprecation of dockershim.
dockershim.sockfrom default runtime endpoints for unix and windowsdockershim.socktocontainerd.sockin the default description for--runtime-endpoints.dockershimfrom the crictl docs (including code examples in the docs)This PR doesn't address
critestmentions ofdockershimas I'm not sure how to do that (but I'm happy to learn).Which issue(s) this PR fixes:
Fixes #870
Special notes for your reviewer:
Does this PR introduce a user-facing change?