News for hackers. Stuff that matters.
Re:Kubernetes is deprecating Docker runtime support by st1x7 on Wednesday December 02, 2020 @02:11PM (#25280167)
(Super naive layman question, I don't work in this space.)

What does this mean? I thought that Kubernetes manages Docker containers which makes the title kind of confusing.

Re:Kubernetes is deprecating Docker runtime support by jsmith45 on Wednesday December 02, 2020 @02:22PM (#25280307)
"docker containers" are more accurately called OCI containers, and have been standardized so that various container runtimes can use exactly the same container images.

Kubernetes can use docker runtime (dockerd) to run OCI containers, but Docker Inc strongly discourages the docker runtime being used directly for infrastructure. Docker runtime imposes a lot of opinionated defaults on containers that are often unwanted by infrastructure projects. (For example docker will automatically edit the /etc/hosts file in containers, in a way that makes little sense for Kubernetes, so Kubernetes has to implement a silly work around to avoid this.)

Instead Docker Inc recommends using containerd as the runtime. containerd implements downloading, unpacking, creating CRI manifests, and running the resulting containers all without implementing docker's opinionated defaults on top. Docker itself uses containerd to actually run the containers, and plans to remove it downloading code in favor of using the one from containerd too.

The only advantage to using docker proper for infrastructure projects is that you can use the docker cli for introspection and debugging. Kubernetes has created its own very similar cli that works with all supported backend runtimes, and also can include relevant Kubernetes specific information in outputs.

Re:Kubernetes is deprecating Docker runtime support by judge2020 on Wednesday December 02, 2020 @02:46PM (#25280653)
> But Docker Inc strongly discourages the docker runtime being used directly for infrastructure.

Is there a list of these defaults or other downsides to using docker instead of containerd?

Re:Kubernetes is deprecating Docker runtime support by mfer on Wednesday December 02, 2020 @02:56PM (#25280780)
Docker did a nice blog post on this a few years ago. Docker uses containerd for running containers. It just does things on top of it that you don't need with Kubernetes. There's a nice diagram in the post, too.

https://www.docker.com/blog/what-is-containerd-runtime/

Re:Kubernetes is deprecating Docker runtime support by jsmith45 on Wednesday December 02, 2020 @03:19PM (#25281028)
I'm not sure of any such list, but using containerd directly is faster, less likely to break k8s when docker adds new features, etc.

Much of this all stems from the flak infrastructure people gave docker when they made swarm part of the engine. But it comes to more than that. Docker has its own take on networking, on volumes, on service discovery, etc. If you are trying to use docker as a component of your own product, at least some of these are likely things you want to implement differently. And the same may well be true of any new features docker wants to add in the future. At which point one must ask why bother using docker directly?

containerd was quite literally created when docker decided to extract the parts of docker that projects like kubernetes might want to use. It has evolved heavily since then, but that really does capture the level at which it sits. This leaves dockerd in charge of things like swarm, docker's view on how networking should work, docker's take on service discovery, dockers view on how shares storage should work, building containers, etc.

Re:Kubernetes is deprecating Docker runtime support by k__ on Wednesday December 02, 2020 @02:38PM (#25280543)
Half-OT: What are alternative runtimes and why would you use them?
Re:Kubernetes is deprecating Docker runtime support by jsmith45 on Wednesday December 02, 2020 @02:57PM (#25280787)
The main alternative runtime that I know of (at the level of containerd) is CRI-O. These runtimes are at the level of fetching images, preparing manifests etc. I'm not really sure what benefits they provide. CRI-O is intended to be kubernetes specific, and thus lacks any features that containerd would have that k8s does not need. This in theory ought to mean smaller, lighter, more easily auditable code.

There is another lower level of runtime, the OCI runtime, of which the main implementation is runc. Alternatives have interesting attributes, like `runv` running containers in VMs with their own kernel to get even grater isolation, `runhcs` which is the OCI runtime for running windows containers, etc. Most if not all of the higher level runtimes allow switching out the OCI runtime, but in general sticking with the default of `runc` is fine.

Re:Kubernetes is deprecating Docker runtime support by ghaff on Wednesday December 02, 2020 @04:05PM (#25281627)
Yeah, the terminology around "runtime" is confusing and is used inconsistently. As you say, the actual runtime is something like runc which CRI-O (and I believe containerd) normally uses. CRI-O, as the name suggests, is an implementation of the Kubernetes Container Runtime Interface--which should work with any OCI-compliant runtime.
Re:Kubernetes is deprecating Docker runtime support by freedomben on Wednesday December 02, 2020 @02:51PM (#25280715)
In the OpenShift world we use CRI-O and it has been awesome for us. I've never actually had it be a problem. Occasionally have to SSH into a node and inspect with crictl to see what's going on but it's almost always PEBKAC that points at CRI-O when it's not CRI-O's fault. I'd definitely recommend looking at it.
Re:Kubernetes is deprecating Docker runtime support by sandGorgon on Thursday December 03, 2020 @12:51AM (#25285853)
How has been your experience with crictl ?

Does it do everything that docker cli does ? Build, pull, etc ?

Re:Kubernetes is deprecating Docker runtime support by jsmith45 on Thursday December 03, 2020 @09:14AM (#25288968)
Only docker, buildkit, podman, buildah, and some non-Dockerfile based tools are able to build. CRI-O or containerd do not have build functionality. It does have pretty much everything else you expect like pull, ps, run exec, attach, rm, rmi, etc.

If you need builds, I'd suggest either run dockerd alongside a containerd kubelet, or use buildkit.

Re:Kubernetes is deprecating Docker runtime support by sandGorgon on Friday December 04, 2020 @02:22AM (#25299874)
That's super valuable. Thanks! I did not know about buildkit (and buildctl), but now see it.

Very valuable. Thanks!!!

Re:Kubernetes is deprecating Docker runtime support by seabrookmx on Wednesday December 02, 2020 @11:34PM (#25285419)
One such alternative runtime with tangible differences to containerd/cri-o is Kata[1], which actually runs OCI images as microvm's. This has some benefits if the applications you're running are untrusted/need additional sandboxing, such as if you're running a PaaS on bare-metal k8s.

[1]: https://github.com/kata-containers/runtime

Re:Kubernetes is deprecating Docker runtime support by k__ on Thursday December 03, 2020 @08:04AM (#25288410)
I did some research, and it also seems that there is a way for containerd to manage Firecracker microvms.
Re:Kubernetes is deprecating Docker runtime support by mfer on Wednesday December 02, 2020 @02:43PM (#25280610)
For a runtime in your Kubernetes cluster there are containerd and cri-o. These are good for Docker / Open Container Initiative images.

There are others... some for non-Docker image support. There are people running other things than just Docker these days. They are more niche case.

Re:Kubernetes is deprecating Docker runtime support by eska on Thursday December 03, 2020 @07:02AM (#25288040)
A simple example would be mostly running Linux applications on Linux machines (= containers), but having a Windows application that needs to run in a Windows VM on a Linux machine (VM, or a container in a VM).
Re:Kubernetes is deprecating Docker runtime support by richardwhiuk on Wednesday December 02, 2020 @06:50PM (#25283432)
OCI container images and Docker images aren't the same.
Re:Kubernetes is deprecating Docker runtime support by dosethree on Thursday December 03, 2020 @12:38PM (#25291751)
it would be more accurate that they both conform to the OCI runtime spec, right?
Re:Kubernetes is deprecating Docker runtime support by nextaccountic on Wednesday December 02, 2020 @02:30PM (#25280426)
Why do you spell containerd as "ContainerD"?

You wrote dockerd without caps.

Re:Kubernetes is deprecating Docker runtime support by tylersmith on Wednesday December 02, 2020 @02:38PM (#25280540)
dockerd is the literal name of a binary while containerd is the name of a project. As far as I can tell containerd stylizes its name in all lowercase but more than half the time I still see it written like a standard name, ContainerD, exactly like this.
Re:Kubernetes is deprecating Docker runtime support by cpuguy83 on Wednesday December 02, 2020 @04:15PM (#25281751)
Being nitpicky here, but the canonical representation of "containerd" is all lowercase, as in the logo.
Re:Kubernetes is deprecating Docker runtime support by astuyvenberg on Wednesday December 02, 2020 @02:17PM (#25280252)
Simply put, Docker includes a bunch of UX components that Kubernetes doesn't need. Kubernetes is currently relying on a shim to interact with the parts that it _does_ need. This change is to simplify the abstraction. You can still use docker to build images deployed via Kubernetes.

Here's an explanation I found helpful:

https://twitter.com/Dixie3Flatline/status/133418891372485017...

Re:Kubernetes is deprecating Docker runtime support by Patrick_Devine on Wednesday December 02, 2020 @04:16PM (#25281759)
Former Docker employee here. We've been busy writing a way to allow you to build OCI images with your Kubernetes cluster using kubectl. This let's you get rid of `docker build` and replace it with `kubectl build`.

You can check out the project here: https://github.com/vmware-tanzu/buildkit-cli-for-kubectl

Re:Kubernetes is deprecating Docker runtime support by jrockway on Wednesday December 02, 2020 @04:37PM (#25281980)
That is a really good idea! Does this just schedule a one-off pod, then have that do the build?
Re:Kubernetes is deprecating Docker runtime support by Patrick_Devine on Wednesday December 02, 2020 @04:58PM (#25282224)
Not quite a one-off pod, but very close to that. It will automatically create a builder pod for you if you don't already have one, or you can specify one with whichever runtime that you want (containerd or docker). It uses buildkit to do the builds and has a syntax which is compatible with `docker build`.

There are also some pretty cool features. It supports building multi-arch images, so you can do things like create x86_64 and ARM images. It can also do build layer caching to a local registry for all of your builders, so it's possible to scale up your pod and then share each of the layers for really efficient builds.

Re:Kubernetes is deprecating Docker runtime support by rcarmo on Thursday December 03, 2020 @02:41AM (#25286559)
That’s pretty nice. One of the things I am curious about is how Kubernetes will deal with private “insecure” in-cluster registries (which are a major pain to set up TLS for when you’re doing edge deployments or stuff that is inherently offline).
Re:Kubernetes is deprecating Docker runtime support by geerlingguy on Wednesday December 02, 2020 @02:19PM (#25280270)
It's a situation where 'Docker' has become eponymous with 'container'. But 'Docker' in this case refers to the runtime that Kubernetes uses to run container images on servers ('nodes') where the UI/UX features of Docker (like it's CLI, image building capabilities, etc.) are not needed.

Container images nowadays can be built by a variety of tools, and run by a variety of tools, with Docker likely being the most popular end-user tool with the most history and name recognition. Others like Podman/Buildah are differently-architected replacements.

As long as a container meets the open container specs, it can be built with whatever tool and run on whatever tool that also follows the specs.

Re:Kubernetes is deprecating Docker runtime support by fulafel on Thursday December 03, 2020 @01:30AM (#25286100)
This holds for OCI style containers, but not all container systems are of the Docker/OCI variety. For example LXD.
Re:Kubernetes is deprecating Docker runtime support by mfer on Wednesday December 02, 2020 @02:31PM (#25280437)
In basic terms... this is a technical detail that isn't going to impact Kubernetes users (a mass majority of them). Those who are concerned with running their workloads in Kubernetes, anyway.

The part of Kubernetes that runs containers has had a shim for docker along with an interface for runtimes to use. It's called the Container Runtime Interface (CRI). The docker shim that worked alongside CRI is being deprecated and now all runtimes (including Docker) will need to use the CRI interface.

These days there are numerous container runtimes one can use. containerd and cri-o are two of them. Container images built with Docker can be run with either of these without anyone noticing.

Re:Kubernetes is deprecating Docker runtime support by lucideer on Wednesday December 02, 2020 @02:28PM (#25280391)
Sibling comments cover the details but to put it simply: there are two definitions of the work "Docker":

1. [common, informal] "An OCI container".

2. [pedantic, strictly accurate] "A set of tools for building & interacting with OCI containers".

This article is talking about the latter definition.

Re:Kubernetes is deprecating Docker runtime support by ghaff on Wednesday December 02, 2020 @02:35PM (#25280490)
It's actually even more confusing than that. There's also Docker, Inc. the company and there used to be the Docker Enterprise product (although I believe newer versions are now Mirantis Enterprise which bought that part of the business).

Docker is pretty much the a textbook example of why you probably shouldn't use the same word for a lot of different things.

Re:Kubernetes is deprecating Docker runtime support by oblio on Wednesday December 02, 2020 @03:18PM (#25281024)
Java :-)

Better yet, .Net.

Re:Kubernetes is deprecating Docker runtime support by ghaff on Wednesday December 02, 2020 @04:08PM (#25281665)
Heh. I can't tell you, especially going back a few years, the number of people who claimed to hate Java with a passion because as far as they were concerned it was that security-shredding dialog box that would pop up demanding to be updated. (OK, there are probably other reasons to dislike Java as well but I agree it's a lot of different things.)
Re:Kubernetes is deprecating Docker runtime support by gjlawran on Thursday December 03, 2020 @11:06AM (#25290244)
MS Teams
Re:Kubernetes is deprecating Docker runtime support by bitdivision on Wednesday December 02, 2020 @02:17PM (#25280247)
It will still run docker containers, they're just deprecating the Docker runtime, which is more of an implementation detail
Re:Kubernetes is deprecating Docker runtime support by jcastro on Wednesday December 02, 2020 @02:18PM (#25280263)
Kubernetes will just use containerd directly, most end users will just continue to use docker on their laptop or whatever. Or you can use something else like podman, it's all OCI: https://opencontainers.org/
Re:Kubernetes is deprecating Docker runtime support by scrappyjoe on Wednesday December 02, 2020 @02:17PM (#25280246)
Kubernetes orchestrates containers, but Docker is just one way of running containers. It wraps all the underlying Linux into a nice set of of easy to use commands. Kubernetes is deprecating interacting with the underlying Linux via the Docker wrapper.
Re:Kubernetes is deprecating Docker runtime support by joeskyyy on Wednesday December 02, 2020 @02:16PM (#25280237)
Kubernetes manages many types of containers, Docker containers just happen to be the most popular (or at least I'd venture to guess). But Kubernetes for a while has supported a few container runtimes (: Here's some k8s docs on a few: https://kubernetes.io/docs/setup/production-environment/cont...