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

Create a doc to explain how to change the runtime (mostly moving away from dockershim) #25879

Closed
SergeyKanzhelev opened this issue Dec 30, 2020 · 30 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/en Issues or PRs related to English language priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@SergeyKanzhelev
Copy link
Member

This is a Feature Request

As part of #25787

What would you like to be added

Have a content_type: task type of a documentation that describe the supported way to transition from one runtime to another. It may be a page under Dockershim deprecation tasks, upgrade doc, or an alternative location under "runtimes".

Why is this needed

With the Dockershim deprecation, having a clear step by step documentation of replacing the runtime would be needed before moving to the next step of dockershim removal.

Comments

KEP: kubernetes/enhancements#2221

See discussions:

/sig node
/cc @neolit123

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 30, 2020
@Aut0R3V
Copy link
Contributor

Aut0R3V commented Jan 1, 2021

Is anyone working on this? I'm interested for working on this issue.

@SergeyKanzhelev
Copy link
Member Author

Is anyone working on this? I'm interested for working on this issue.

nobody working on it right now. So please go ahead. Do you want to discuss the proper placement of this document in the issue of prefer to start with the draft of a document?

@Aut0R3V
Copy link
Contributor

Aut0R3V commented Jan 7, 2021

It'll be great to hear whatever you can recommend. I'll send in a draft then

@SergeyKanzhelev
Copy link
Member Author

It'll be great to hear whatever you can recommend. I'll send in a draft then

Sorry for delay. My suggestion would be to start with the document that replicates content from "Upgrade worker nodes" section here: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/#upgrade-worker-nodes

And instead of kubelet update - provide instructions on changing from docker to containerd.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 21, 2021
@neolit123
Copy link
Member

neolit123 commented Apr 21, 2021 via email

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 21, 2021
@msschl
Copy link

msschl commented Jul 5, 2021

Any updates on this? Would be nice to have a migration guide as we plan to move our kubeadm cluster away from dockershim.

@neolit123
Copy link
Member

i'm pretty sure the steps would be similar to this:
https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/configure-cgroup-driver/#migrating-to-the-systemd-driver

...
Stop the container runtime
...
Start the container runtime <-- here is where you start a different container runtime
...

but SIG node should confirm if this is actually the right way.

you could create a test cluster and try migrating it.

@k8s-triage-robot
Copy link

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:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 3, 2021
@Debanitrkl
Copy link
Member

/remove-lifecycle stale
Working on this here kubernetes/kubernetes#104878

@sftim
Copy link
Contributor

sftim commented Dec 7, 2021

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 7, 2021
@sftim
Copy link
Contributor

sftim commented Dec 7, 2021

/language en
/kind feature

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Dec 7, 2021
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 7, 2021
@sftim
Copy link
Contributor

sftim commented Dec 7, 2021

/priority important-soon
Folks want to know how to migrate

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Dec 7, 2021
@afbjorklund
Copy link

afbjorklund commented Dec 10, 2021

We are missing documentation on how to move docker build away from dockerd, over to buildkitd...

Moving away from Docker leaves users without any documented method of building container images.

Suggested migration approaches include using sudo nerdctl.

Or even writing your own buildctl wrapper, like minikube had to.

@sftim
Copy link
Contributor

sftim commented Dec 10, 2021

https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/ covers why you can still use docker build.

@afbjorklund
Copy link

afbjorklund commented Dec 10, 2021

I was specifically referring to the (questionable) practice of building container images directly on the nodes.

It is not possible to use docker build, if dockerd has been replaced with containerd. Need to add buildkitd.

It is mostly a problem for single-node clusters, like minikube.

But it could be worth more than a little side note, like now ?

https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/#role-of-dockershim

"You can still pull images or build them using docker build command. But images built or pulled by Docker would not be visible to container runtime and Kubernetes. They needed to be pushed to some registry to allow them to be used by Kubernetes."

@afbjorklund
Copy link

afbjorklund commented Dec 18, 2021

The FAQ has been updated, and has better info about building (after switching to containerd) now:

https://kubernetes.io/blog/2020/12/02/dockershim-faq/#what-should-i-look-out-for-when-changing-cri-implementations

Another thing to look out for is anything expecting to run for system maintenance or nested inside a container when building images will no longer work. For the former, you can use the crictl tool as a drop-in replacement (see mapping from docker cli to crictl) and for the latter you can use newer container build options like img, buildah, kaniko, or buildkit-cli-for-kubectl that don’t require Docker.

We detailed the manual steps in minikube, such as installing and configuring buildkitd and buildctl:

https://minikube.sigs.k8s.io/docs/handbook/pushing/#6-pushing-directly-to-in-cluster-containerd-buildkitd

Using kubectl build is a more flexible, even if slightly more complicated, way of doing the same thing:

https://github.com/vmware-tanzu/buildkit-cli-for-kubectl/blob/main/docs/architecture.md (under "directly")

@KelvinAkpobome
Copy link
Contributor

I will like to take on this

@chris-short
Copy link
Contributor

/assign @chrisnegus

@chrisnegus
Copy link
Contributor

chrisnegus commented Apr 3, 2022

I believe documentation is done to meet the intent of this issue, including How to find out what container runtime is used on a Node, as well as instructions for migrating from using dockershim to:

Beyond that, @afbjorklund asked for docs describing replacements for using docker build on nodes, then points to content covering that topic in this comment. I will give everyone few days to comment on whether more is needed before I close this Issue.

@afbjorklund
Copy link

As far as I know, the information on how to build images is available in the container runtimes (outside k8s.io).

The main highlight was that it is not covered with crictl, so that you need to use something outside of CRI ?

For containerd, that means installing and configuring buildkit.

But it does not have to be addressed before closing this issue.

@chrisnegus
Copy link
Contributor

@afbjorklund Thanks for your insight here. Would it be appropriate to open a separate issue for the k8s.io docs to cover the issue of building containers (that could be handled after 1.24) or it is okay to leave that to the runtime docs, outside of k8s.io?

@afbjorklund
Copy link

afbjorklund commented Apr 4, 2022

It is my understanding that kubernetes.io will not carry any documentation for any container runtime.

Each runtime will document, how you do docker build or podman build or nerdctl build or whatever ?

But please check with the SIG Docs members, I was just remotely following issues such as PR #32738.

For minikube the situation is slightly different, since the container runtime is provided by the project too...

@sftim
Copy link
Contributor

sftim commented Apr 4, 2022

If we wanted to explain how to build container images, that might be a topic better covered on the blog.

If someone wants to, that could either be a survey of existing articles that already cover it (there must be hundreds), or a new article that also explains how to get your built container running in Kubernetes.

I think that's a separate thing from what this issue is about: explaining how to change which container runtime your cluster uses.

@sftim
Copy link
Contributor

sftim commented Apr 4, 2022

@chrisnegus I suggest marking this as done, and tracking a new issue (based on something I just spotted):

The v1.24 docs recommend moving away from dockershim. I think we need to word it more strongly than that.

Do you agree?

@afbjorklund
Copy link

We added minikube image build and minikube image load, to help users move away from using docker.

Some users might prefer to run two VMs, one for building images and one (or more) for running the cluster.
That works fine too (just slower), and then they can have dockerd in the first and containerd in the second.

The only thing we need to explain, is that if they change their runtime - our "docker-env" stops working.

❌ Exiting due to MK_USAGE: The docker-env command is only compatible with the "docker" runtime, but this cluster was configured to use the "containerd" runtime.

Hopefully the (minikube) error message is clear enough.

@chrisnegus
Copy link
Contributor

@chrisnegus I suggest marking this as done, and tracking a new issue (based on something I just spotted):

The v1.24 docs recommend moving away from dockershim. I think we need to word it more strongly than that.

Do you agree?

I agree. I think we can close this issue, since the migration content has been addressed and we are well enough covered for image building documentation. I'll open a post-1.24 Issue to consider stronger wording to people for getting off of Dockershim.

@chrisnegus
Copy link
Contributor

/close

@k8s-ci-robot
Copy link
Contributor

@chrisnegus: Closing this issue.

In response to this:

/close

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.

@chrisnegus
Copy link
Contributor

chrisnegus commented Apr 10, 2022

@chrisnegus I suggest marking this as done, and tracking a new issue (based on something I just spotted):
The v1.24 docs recommend moving away from dockershim. I think we need to word it more strongly than that.
Do you agree?
I agree. I think we can close this issue, since the migration content has been addressed and we are well enough covered for image building documentation. I'll open a post-1.24 Issue to consider stronger wording to people for getting off of Dockershim.

Done. I opened Issue #32827. I think we should revisit it after 1.24.

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. language/en Issues or PRs related to English language priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/node Categorizes an issue or PR as relevant to SIG Node. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests