News for hackers. Stuff that matters.
Re:Kubernetes is deprecating Docker runtime support by qz2 on Wednesday December 02, 2020 @02:05PM (#25280086)
Can someone explain how logging is supposed to work after this change? I’m complete bloody lost.

Actually I’m nearly always lost with kubernetes. It’s either broken or changing.

Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Wednesday December 02, 2020 @02:16PM (#25280243)
Loosely, my understanding Kubernetes works like this:

You have a Pod definition, which is basically a gang of containers. In that Pod definition you have included one or more container image references.

You send the Pod definition to the API Server.

The API Server informs listeners for Pod updates that there is a new Pod definition. One of these listeners is the scheduler, which decides which Node should get the Pod. It creates an update for the Pod's "status", essentially annotating it with the name of the Node that should run the Pod.

Each Node has a "kubelet". These too subscribe to Pod definitions. When a change shows up saying "Pod 'foo' should run on Node 27", the kubelet in Node 27 perks up its ears.

The kubelet converts the Pod definition into descriptions of containers -- image reference, RAM limits, which disks to attach etc. It then turns to its container runtime through the "Container Runtime Interface" (CRI). In the early days this was a Docker daemon.

The container runtime now acts on the descriptions it got. Most notably, it will check to see if it has an image in its local cache; if it doesn't then it will try to pull that image from a registry.

Now: The CRI is distinct from the Docker daemon API. The CRI is abstracted because since the Docker daemon days, other alternatives have emerged (and some have withered), such as rkt, podman and containerd.

This update says "we are not going to maintain the Docker daemon option for CRI". You can use containerd. From a Kubernetes end-user perspective, nothing should change. From an operator perspective, all that happens is that you have a smaller footprint with less attack surface.

Re:Kubernetes is deprecating Docker runtime support by rsanheim on Wednesday December 02, 2020 @02:25PM (#25280345)
I'm sure all this complexity makes sense for all sorts of reasons buried in the history of Kubernetes development at Google. "Things are the way they are because they got that way."

The fact that so many other orgs, many of which are startups or just small to medium sized tech companies, use a system this complex is ludicrous to me.

Re:Kubernetes is deprecating Docker runtime support by lima on Wednesday December 02, 2020 @04:59PM (#25282231)
Hi! Small tech company that uses k8s here. Much of the complexity is irreducible and has to go somewhere, and it's much better to have it in a single, stateless, well-defined place that's also easy too introspect.

I've seen way too many Ansible nightmares grown out of deceptively "simple" mutable VM deployments.

k8s makes our life so much easier because it eliminates a whole bunch of other complexity. Easily reproducible development environments, workload scheduling, sane config management...

Re:Kubernetes is deprecating Docker runtime support by LimaBearz on Thursday December 03, 2020 @01:12AM (#25285978)
My favorite opposite of this is companies running k8s, using a ansible to build state on launch..
Re:Kubernetes is deprecating Docker runtime support by comfydragon on Wednesday December 02, 2020 @03:08PM (#25280905)
The practical change that's happening is that in future versions of Kubernetes, they're removing support for using a shim for telling the Docker daemon to run containers, and focusing on just using containerd (which Docker uses under the covers anyway).

It's kind of like if you had a shell script to launch programs, and it used to move the mouse to press icons, but now you've deprecated that and will only run programs directly.

Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Wednesday December 02, 2020 @02:27PM (#25280370)
Well, I might have designed it differently, but I wasn't there. For what it does, this architecture works well. More to the point: none of it is visible to end-users of Kubernetes. You send a Pod definition, some magic happens, pow! running software.
Re:Kubernetes is deprecating Docker runtime support by tannhaeuser on Wednesday December 02, 2020 @03:01PM (#25280839)
Except when it doesn't, at which point you're lost.
Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Wednesday December 02, 2020 @03:06PM (#25280883)
Well, like I said, I might have done it differently. But there's a consistent logic to how it works[0]. That carries a lot of water.

[0] most folks emphasise the control loop aspect, I think it's more helpful to point to blackboard / tuple-space systems as prior art.

Re:Kubernetes is deprecating Docker runtime support by tannhaeuser on Thursday December 03, 2020 @03:32AM (#25286833)
> I think it's more helpful to point to blackboard / tuple-space systems as prior art

Ah, nevermind then, that gives me rest concerning the viability and transparency of it all.

Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Thursday December 03, 2020 @12:52PM (#25291985)
I'm glad I could help.
Re:Kubernetes is deprecating Docker runtime support by yipbub on Thursday December 03, 2020 @08:19AM (#25288518)
It's a generic API for automated provisioning. It asks you to make some decisions up front (what do you want to do when an instance goes down or has a new version available), and lets you forgo making some (like which nodes your instance should run on).

It's not more complex. If you're small, the overhead is probably not worth it. If you're big enough, you manage the k8s control plane, and you don't have to manage your tenants infra.

Is a programming language too complex for hello world? Perhaps, but that's not all it does.

Re:Kubernetes is deprecating Docker runtime support by mplewis on Wednesday December 02, 2020 @06:13PM (#25283060)
You don't need the complexity until you do, and then you're facing a rewrite into the complex system. Defining a deployment in YAML isn't really all that hard.
Re:Kubernetes is deprecating Docker runtime support by freedomben on Wednesday December 02, 2020 @03:01PM (#25280838)
You pretty much nailed it. This is a super useful "elevator description" to give to people. Mind if I share it (with attribution)? Even better if you slap it into a blog post or something (except a tweet thread :-D), but HN is perfectly fine :-)
Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Wednesday December 02, 2020 @03:04PM (#25280866)
Thankyou, I'm flattered. Please feel free to share.
Re:Kubernetes is deprecating Docker runtime support by kgoutham93 on Wednesday December 02, 2020 @10:45PM (#25285119)
Noob question:

As I understand, dockershim makes docker daemon cri compliant. But dockerd already uses containerd which is cri compliant. So, why can't kubelet directly interact with containerd APIs without dockershim?

Re:Kubernetes is deprecating Docker runtime support by euank on Thursday December 03, 2020 @02:54AM (#25286630)
The kubelet can talk to containerd's cri endpoint, yes, but there's one additional bit of complexity.

If someone wants to use kubelet + docker so that they can, for example, ssh into a node and type 'docker ps' to see containers, or have something else using the docker api see the containers the kubelet started, that won't work after re-pointing the kubelet from docker to containerd.

The difference here is namespacing[0], but not the linux-kernel-container-namespace, rather the containerd concept by the same name to allow "multi-tenancy" of a single containerd daemon.

In addition, I don't think you could have docker + cri run in the same containerd namespace since they end up using different networking and storage containerd plugins. I think that terminology is right.

So yeah, repointing the kubelet to containerd directly works fine, but it won't be the same thing as running docker containers.

[0]: https://github.com/containerd/containerd/blob/9561d938/docs/...

Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Thursday December 03, 2020 @01:05AM (#25285939)
> So, why can't kubelet directly interact with containerd APIs without dockershim?

Each kubelet does its thing through the Container Runtime Interface (CRI), so in a sense it doesn't know what it's running on. If it used containerd's interfaces directly, it wouldn't be possible to substitute in a different option.

For example, there are emerging VM-based approaches like Firecracker and VMware "Project Pacific" (disclosure: I work at VMware).

Re:Kubernetes is deprecating Docker runtime support by chucky_z on Wednesday December 02, 2020 @03:07PM (#25280892)
The GP did ask about logging though specifically. One of Docker daemon's more interesting features is how much log enrichment it does. Does kubelet do the same thing out of the box? I know containerd itself does not, unfortunately.
Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Wednesday December 02, 2020 @03:08PM (#25280910)
Yes, I overlooked that. I am afraid I don't know, but since the Docker daemon now relies on the same code, I would expect that there's similar functionality at that level.
Re:Kubernetes is deprecating Docker runtime support by throwaway201103 on Wednesday December 02, 2020 @02:30PM (#25280418)
> I’m nearly always lost with kubernetes. It’s either broken or changing.

Glad I'm not the only one. I'm sure I'm not the smartest engineer/sysadmin in the world, but I'm also not the dumbest and I have never gotten an on-premises Kubernetes installation to work.

The way I manage containers is lxc and shell scripts. I understand it, and it works.

Re:Kubernetes is deprecating Docker runtime support by freedomben on Wednesday December 02, 2020 @03:04PM (#25280867)
I work for Red Hat as an OpenShift Consultant, so I'm on the bleeding edge of change and am constantly pushing boundaries.

Don't tell the boss or the customers, but most of the time when release notes for a new version come out, I look at them and go "WTF, why do we need that, I better do some research." It's fast changing, complex as hell, and absolutely brutal. That said most things are there for a reason and once I dig in I usually see the need.

That said I do love it despite its warts. There's no doubt some Stockholm Syndrome at play here, but I love the API (which is pretty curlable btw, a mark of a great API IMHO) and the principles (declarative, everything's a YAML/JSON object in etcd, etc). I see it the same way I did C++ (which I also loved). It gives you great power which you can use to build an elegant, robust system, or you can create an unmaintainable, complex, monster of a nightmare. It's up to you.

Re:Kubernetes is deprecating Docker runtime support by jacques_chester on Wednesday December 02, 2020 @03:59PM (#25281557)
The full-time job of keeping up with Kubernetes was published in February 2018[0] and things have only gotten faster since then.

[0] https://goteleport.com/blog/kubernetes-release-cycle/ , HN discussion: https://news.ycombinator.com/item?id=16285192

Re:Kubernetes is deprecating Docker runtime support by mschuster91 on Wednesday December 02, 2020 @04:06PM (#25281637)
Getting Kubernetes itself running on bare metal ("running" as in "you have containers and can access them") is half a day of work.

What is deadly difficult is getting networking to work. Even a comparably "easy" thing with a couple of two-NIC machines (one external, internet-routable, one DMZ) cost me a fucking week.

What's even worse is when one has to obey corporate restrictions - for example, only having external interfaces on "loadbalancer" nodes:

- First of all, MetalLB only has one active Speaker node which means your bandwidth is limited to that node's uplink and you're wasting the resources of the other loadbalancers.

- Second, you can taint your nodes to only schedule the MetalLB speaker on your "loadbalancer" nodes via tolerations... but how the f..k do you convince MetalLB to change the speaker node once you apply that change?!

- Third, what do you do when you want to expose N services but only have one or two external IPs? DC/OS was way more flexible, you had one set of loadbalancers (haproxy) that did all the routing, and could run an entire cluster on four machines - two LBs, one master, one worker. There is no way to replicate this with Kubernetes. None.

Re:Kubernetes is deprecating Docker runtime support by throwaway201103 on Wednesday December 02, 2020 @05:33PM (#25282649)
Yes, it's the networking that never works for me either. I'm one guy, wear many hats, and don't have time to chase rabbits down holes. If I follow published instructions and it doesn't work, I pretty much stop there.
Re:Kubernetes is deprecating Docker runtime support by chucky_z on Wednesday December 02, 2020 @03:09PM (#25280918)
Give nomad, docker swarm, or lxd a shot.
Re:Kubernetes is deprecating Docker runtime support by yjftsjthsd-h on Wednesday December 02, 2020 @05:15PM (#25282439)
I'm currently involved in an effort to rip out docker swarm at work because its overlay networks are shockingly unreliable. LXD looks interesting but https://linderud.dev/blog/packaging-lxd-for-arch-linux/ convinced me that it's another Canonical NIH special and probably best avoided (in particular, "only distributed for Ubuntu via snaps" means "forces auto-updates" which means "not going in my environment"). Need to try Nomad; I'm cautiously optimistic since the rest of HashiCorp's stuff is good.
Re:Kubernetes is deprecating Docker runtime support by chucky_z on Wednesday December 02, 2020 @09:17PM (#25284482)
Nomad 1.0 is the bomb. I've ran Nomad since 0.7 and it was usable but pretty rough in those days. 1.0 is such a good, smooth thing. Super awesome even if you don't want to use Docker at all, you can just execute random stuff through exec/raw_exec, or straight Java. Heck, run it in a BSD homelab and use one of the jailshell executors.

It's not Kubernetes but it doesn't try to be at all.

Re:Kubernetes is deprecating Docker runtime support by albatruss on Monday December 07, 2020 @04:32PM (#25337856)
Is this on 19.x swarm mode? I thought it got a lot more reliable with that release.
Re:Kubernetes is deprecating Docker runtime support by disgruntledphd2 on Wednesday December 02, 2020 @02:16PM (#25280234)
Welcome to modern software development, apparently.
Re:Kubernetes is deprecating Docker runtime support by qz2 on Wednesday December 02, 2020 @03:53PM (#25281468)
Modern software development makes me wish I was born in the late 1940s.
Re:Kubernetes is deprecating Docker runtime support by von_neumann on Wednesday December 02, 2020 @09:59PM (#25284787)
You like punch-cards? Because that is how you get them!
Re:Kubernetes is deprecating Docker runtime support by lokedhs on Wednesday December 02, 2020 @10:40PM (#25285086)
If you're born in the late 40's, you'd probably have been exposed to some punch cards but when starting work, it'd be the 70's already. I'm sure there was still punch cards around at the time, but at least you had printing terminals if not monitor-based terminals.

That said, depending on where you were working, things could also change fast. You could find yourself finding that a kernel system call had changed because someone patched it the evening before.

Re:Kubernetes is deprecating Docker runtime support by qz2 on Thursday December 03, 2020 @02:17AM (#25286417)
Yes. Plenty of time to think before doing.