|
| 1 | +--- |
| 2 | +title: Check whether Dockershim deprecation affects you |
| 3 | +content_type: task |
| 4 | +reviewers: |
| 5 | +- SergeyKanzhelev |
| 6 | +weight: 20 |
| 7 | +--- |
| 8 | + |
| 9 | +<!-- overview --> |
| 10 | + |
| 11 | +The `dockershim` component of Kubernetes allows to use Docker as a Kubernetes's |
| 12 | +{{< glossary_tooltip text="container runtime" term_id="container-runtime" >}}. |
| 13 | +Kubernetes' built-in `dockershim` component was deprecated in release v1.20. |
| 14 | + |
| 15 | +This page explains how your cluster could be using Docker as a container runtime, |
| 16 | +provides details on the role that `dockershim` plays when in use, and shows steps |
| 17 | +you can take to check whether any workloads could be affected by `dockershim` deprecation. |
| 18 | + |
| 19 | +## Finding if your app has a dependencies on Docker {#find-docker-dependencies} |
| 20 | + |
| 21 | +If you are using Docker for building your application containers, you can still |
| 22 | +run these containers on any container runtime. This use of Docker does not count |
| 23 | +as a dependency on Docker as a container runtime. |
| 24 | + |
| 25 | +When alternative container runtime is used, executing Docker commands may either |
| 26 | +not work or yield unexpected output. This is how you can find whether you have a |
| 27 | +dependency on Docker: |
| 28 | + |
| 29 | +1. Make sure no privileged Pods execute Docker commands. |
| 30 | +2. Check that scripts and apps running on nodes outside of Kubernetes |
| 31 | + infrastructure do not execute Docker commands. It might be: |
| 32 | + - SSH to nodes to troubleshoot; |
| 33 | + - Node startup scripts; |
| 34 | + - Monitoring and security agents installed on nodes directly. |
| 35 | +3. Third-party tools that perform above mentioned privileged operations. See |
| 36 | + [Migrating telemetry and security agents from dockershim](/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents) |
| 37 | + for more information. |
| 38 | +4. Make sure there is no indirect dependencies on dockershim behavior. |
| 39 | + This is an edge case and unlikely to affect your application. Some tooling may be configured |
| 40 | + to react to Docker-specific behaviors, for example, raise alert on specific metrics or search for |
| 41 | + a specific log message as part of troubleshooting instructions. |
| 42 | + If you have such tooling configured, test the behavior on test |
| 43 | + cluster before migration. |
| 44 | + |
| 45 | +## Dependency on Docker explained {#role-of-dockershim} |
| 46 | + |
| 47 | +A [container runtime](/docs/concepts/containers/#container-runtimes) is software that can |
| 48 | +execute the containers that make up a Kubernetes pod. Kubernetes is responsible for orchestration |
| 49 | +and scheduling of Pods; on each node, the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} |
| 50 | +uses the container runtime interface as an abstraction so that you can use any compatible |
| 51 | +container runtime. |
| 52 | + |
| 53 | +In its earliest releases, Kubernetes offered compatibility with just one container runtime: Docker. |
| 54 | +Later in the Kubernetes project's history, cluster operators wanted to adopt additional container runtimes. |
| 55 | +The CRI was designed to allow this kind of flexibility - and the kubelet began supporting CRI. However, |
| 56 | +because Docker existed before the CRI specification was invented, the Kubernetes project created an |
| 57 | +adapter component, `dockershim`. The dockershim adapter allows the kubelet to interact with Docker as |
| 58 | +if Docker were a CRI compatible runtime. |
| 59 | + |
| 60 | +You can read about it in [Kubernetes Containerd integration goes GA](/blog/2018/05/24/kubernetes-containerd-integration-goes-ga/) blog post. |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +Switching to Containerd as a container runtime eliminates the middleman. All the |
| 65 | +same containers can be run by container runtimes like Containerd as before. But |
| 66 | +now, since containers schedule directly with the container runtime, they are not visible to Docker. |
| 67 | +So any Docker tooling or fancy UI you might have used |
| 68 | +before to check on these containers is no longer available. |
| 69 | + |
| 70 | +You cannot get container information using `docker ps` or `docker inspect` |
| 71 | +commands. As you cannot list containers, you cannot get logs, stop containers, |
| 72 | +or execute something inside container using `docker exec`. |
| 73 | + |
| 74 | +{{< note >}} |
| 75 | + |
| 76 | +If you're running workloads via Kubernetes, the best way to stop a container is through |
| 77 | +the Kubernetes API rather than directly through the container runtime (this advice applies |
| 78 | +for all container runtimes, not just Docker). |
| 79 | + |
| 80 | +{{< /note >}} |
| 81 | + |
| 82 | +You can still pull images or build them using `docker build` command. But images |
| 83 | +built or pulled by Docker would not be visible to container runtime and |
| 84 | +Kubernetes. They needed to be pushed to some registry to allow them to be used |
| 85 | +by Kubernetes. |
0 commit comments