Skip to content

Commit a6e48cb

Browse files
authored
Merge pull request #25360 from mrbobbytables/faq
Add dockershim faq
2 parents 6e369f6 + cf92dc8 commit a6e48cb

File tree

1 file changed

+180
-0
lines changed

1 file changed

+180
-0
lines changed
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
---
2+
layout: blog
3+
title: "Dockershim Deprecation FAQ"
4+
date: 2020-12-02
5+
slug: dockershim-faq
6+
aliases: [ '/dockershim' ]
7+
---
8+
9+
This document goes over some frequently asked questions regarding the Dockershim
10+
depreaction announced as a part of the Kubernetes v1.20 release. For more detail
11+
on the deprecation of Docker as a container runtime for Kubernetes kubelets, and
12+
what that means, check out the blog post
13+
[Don't Panic: Kubernetes and Docker](/blog/2020/12/02/dont-panic-kubernetes-and-docker/).
14+
15+
### Why is dockershim being deprecated?
16+
17+
Maintaining dockershim has become a heavy burden on the Kubernetes maintainers.
18+
The CRI standard was created to reduce this burden and allow smooth interoperability
19+
of different container runtimes. Docker itself doesn't currently implement CRI,
20+
thus the problem.
21+
22+
Dockershim was always intended to be a temporary solution (hence the name: shim).
23+
You can read more about the community discussion and planning in the
24+
[Dockershim Removal Kubernetes Enhancement Proposal][drkep].
25+
26+
Additionally, features that were largely incompatible with the dockershim, such
27+
as cgroups v2 and user namespaces are being implemented in these newer CRI
28+
runtimes. Removing support for the dockershim will allow further development in
29+
those areas.
30+
31+
[drkep]: https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/1985-remove-dockershim
32+
33+
### Can I still use Docker in Kubernetes 1.20?
34+
35+
Yes, the only thing changing in 1.20 is a single warning log printed at [kubelet]
36+
startup if using Docker as the runtime.
37+
38+
[kubelet]: /docs/reference/command-line-tools-reference/kubelet/
39+
40+
41+
### When will dockershim be removed?
42+
43+
Given the impact of this change, we are using an extended deprecation timeline.
44+
It will not be removed before Kubernetes 1.22, meaning the earliest release without
45+
dockershim would be 1.23 in late 2021. We will be working closely with vendors
46+
and other ecosystem groups to ensure a smooth transition and will evaluate things
47+
as the situation evolves.
48+
49+
50+
### Will my existing Docker images still work?
51+
52+
Yes, the images produced from `docker build` will work with all CRI implementations.
53+
All your existing images will still work exactly the same.
54+
55+
56+
### What about private images?
57+
58+
Also yes. All CRI runtimes support the same pull secrets configuration used in
59+
Kubernetes, either via the PodSpec or ServiceAccount.
60+
61+
62+
### Are Docker and containers the same thing?
63+
64+
Docker popularized the Linux containers pattern and has been instrumental in
65+
developing the underlying technology, however containers in Linux have existed
66+
for a long time. The container ecosystem has grown to be much broader than just
67+
Docker. Standards like OCI and CRI have helped many tools grow and thrive in our
68+
ecosystem, some replacing aspects of Docker while others enhance existing
69+
functionality.
70+
71+
72+
### Are there examples of folks using other runtimes in production today?
73+
74+
All Kubernetes project produced artifacts (Kubernetes binaries) are validated
75+
with each release.
76+
77+
Additionally, the [kind] project has been using containerd for some time and has
78+
seen an improvement in stability for its use case. Kind and containerd are leveraged
79+
multiple times every day to validate any changes to the Kubernetes codebase. Other
80+
related projects follow a similar pattern as well, demonstrating the stability and
81+
usability of other container runtimes. As an example, OpenShift 4.x has been
82+
using the [CRI-O] runtime in production since June 2019.
83+
84+
For other examples and references you can look at the adopters of containerd and
85+
cri-o, two container runtimes under the Cloud Native Computing Foundation ([CNCF]).
86+
- [containerd](https://github.com/containerd/containerd/blob/master/ADOPTERS.md)
87+
- [CRI-O](https://github.com/cri-o/cri-o/blob/master/ADOPTERS.md)
88+
89+
[CRI-O]: https://cri-o.io/
90+
[kind]: https://kind.sigs.k8s.io/
91+
[CNCF]: https://cncf.io
92+
93+
94+
### People keep referencing OCI, what is that?
95+
96+
OCI stands for the [Open Container Initiative], which standardized many of the
97+
interfaces between container tools and technologies. They maintain a standard
98+
specification for packaging container images (OCI image-spec) and running containers
99+
(OCI runtime-spec). They also maintain an actual implementation of the runtime-spec
100+
in the form of [runc], which is the underlying default runtime for both
101+
[containerd] and [CRI-O]. The CRI builds on these low-level specifications to
102+
provide an end-to-end standard for managing containers.
103+
104+
[Open Container Initative]: https://opencontainers.org/about/overview/
105+
[runc]: https://github.com/opencontainers/runc
106+
[containerd]: https://containerd.io/
107+
108+
109+
### Which CRI implementation should I use?
110+
111+
That’s a complex question and it depends on a lot of factors. If Docker is
112+
working for you, moving to containerd should be a relatively easy swap and
113+
has have strictly better performance and less overhead. However we encourage you
114+
to explore all the options from the [CNCF landscape] in case another would be an
115+
even better fit for your environment.
116+
117+
[CNCF landscape]: https://landscape.cncf.io/category=container-runtime&format=card-mode&grouping=category
118+
119+
120+
### What should I look out for when changing CRI implementations?
121+
122+
While the underlying containerization code is the same between Docker and most
123+
CRIs (including containerd), there are a few differences around the edges. Some
124+
common things to consider when migrating are:
125+
126+
- Logging configuration
127+
- Runtime resource limitations
128+
- Node provisioning scripts that call docker or use docker via it's control socket
129+
- Kubectl plugins that require docker CLI or the control socket
130+
- Kubernetes tools that require direct access to Docker (e.g. kube-imagepuller)
131+
- Configuration of functionality like `registry-mirrors` and insecure registries
132+
- Other support scripts or daemons that expect docker to be available and are run
133+
outside of Kubernetes (e.g. monitoring or security agents)
134+
- GPUs or special hardware and how they integrate with your runtime and Kubernetes
135+
136+
If you use Kubernetes resource requests/limits or file-based log collection
137+
DaemonSets then they will continue to work the same, but if you’ve customized
138+
your dockerd configuration, you’ll need to adapt that for your new container
139+
runtime where possible.
140+
141+
Another thing to look out for is anything expecting to run for system maintenance
142+
or nested inside a container when building images will no longer work. For the
143+
former, you can use the [`crictl`][cr] tool as a drop-in replacement and for the
144+
latter you can use newer container build options like [img], [buildah], or
145+
[kaniko] that don’t require Docker.
146+
147+
[cr]: https://github.com/kubernetes-sigs/cri-tools
148+
[img]: https://github.com/genuinetools/img
149+
[buildah]: https://github.com/containers/buildah
150+
[kaniko]: https://github.com/GoogleContainerTools/kaniko
151+
152+
For containerd, you can start with their [documentation] to see what configuration
153+
options are available as you migrate things over.
154+
155+
[documentation]: https://github.com/containerd/cri/blob/master/docs/registry.md
156+
157+
For instructions on how to use containerd and CRI-O with Kubernetes, see the
158+
Kubernetes documentation on [Container Runtimes]
159+
160+
[Container Runtimes]: /docs/setup/production-environment/container-runtimes
161+
162+
163+
### What if I have more questions?
164+
165+
If you use a vendor-supported Kubernetes distribution, you can ask them about
166+
upgrade plans for their products. For end-user questions, please post them
167+
to our end user community forum: https://discuss.kubernetes.io/.
168+
169+
You can also check out the excellent blog post
170+
[Wait, Docker is deprecated in Kubernetes now?][dep] a more in-depth technical
171+
discussion of the changes.
172+
173+
[dep]: https://dev.to/inductor/wait-docker-is-deprecated-in-kubernetes-now-what-do-i-do-e4m
174+
175+
176+
### Can I have a hug?
177+
178+
Always and whenever you want! 🤗🤗
179+
180+

0 commit comments

Comments
 (0)