News for hackers. Stuff that matters.
Re:K3s: Kubernetes without the features I don't care about by nwmcsween on Wednesday September 26, 2018 @08:34PM (#18081375)
OT but why do you want to push containers? In my opinion it's a misadventure from the real issue of a proper package manager (which in turn is a misadventure from a proper build system) The issue with current containers is it's the wrong level of abstraction, containment should be per binary and ideally inline with code (see pledge(2)).
Re:K3s: Kubernetes without the features I don't care about by cyphar on Wednesday September 26, 2018 @10:16PM (#18081686)
As one of the maintainers of runc, I cannot agree with your general thrust more (I am obviously biased since I work for a distribution company -- SUSE). I don't agree it should be containment-per-binary, but I think that containment should be transparent to the operating system so it can be managed.

Currently the idea with k8s is that you just destroy anything that has broken state and rebuild it somewhere else. While this is the easiest solution to the problem, I think that containers should not always be treated like disposable objects.

I think in many ways, Solaris Zones (and FreeBSD Jails to a lesser extent) did this right. Every administrative command in Solaris is zone-aware and you can manage your zones like you manage your host. On Linux, containers are completely opaque root filesystems which contain who-knows-what and are completely unmanagable or introspectable by the host. Everyone is cargo-culting and creating hacks around this fundamentally opaque system to try to make it less opaque (or just giving up and making it easy to purge them).

I'm working on some improvements to the OCI image-spec that _might_ help with introspection of images[1], but runtime introspection is going to be quite hard (needs runtime agreement).

I get that it's no longer sexy to work on container runtimes, now that everyone is losing their mind over orchestrators (and I imagine soon they'll be losing their mind over the next big thing). But I think that improving these fundamental blocks is pretty interesting and might result in better systems.

[1]: https://github.com/openSUSE/umoci/issues/256

Re:K3s: Kubernetes without the features I don't care about by pm90 on Thursday September 27, 2018 @12:32AM (#18082116)
It was never sexy to work on container runtimes, and nobody is losing their minds over orchestrators either. There was a real need for a platform to deploy to without being tied in to {aws, gcp, etc}. First it was OpenStack, now its kubernetes.
Re:K3s: Kubernetes without the features I don't care about by ofrzeta on Thursday September 27, 2018 @05:44AM (#18083127)
> I think that containment should be transparent to the operating system so it can be managed

you mean, as in "VM"? :)

Re:K3s: Kubernetes without the features I don't care about by cyphar on Friday September 28, 2018 @02:10AM (#18091388)
VMs are entirely opaque to the host operating system. I'm not sure what the parallel is (though I assume you were being tongue-in-cheek).
Re:K3s: Kubernetes without the features I don't care about by ofrzeta on Saturday September 29, 2018 @05:17PM (#18102880)
Well, I always had problems differentiating "opaque" and "transparent" because depending on your point of view often both concepts can be applied interchangeably.

For instance in your post I didn't really get your point because at one time you seem to favor containers as a single entity from the perspective of the OS so they can be easily managed. This is what I understand you called "transparent to the OS". The is opposed to the container root fs that you call "opaque", supposedly because it cannot be easily mounted from the host OS etc.

As the implementor of container runtimes you know that there's not a container entity but an agglomeration of isolation techniques such as namespaces, cgroups etc. including some kind of overlay fs that make up an actual container. For me that's not very transparent. VMs on the other hand are in that respect – in a similar way Solaris zones and Jails are, as they are actual entities that can be seen and managed on the host OS.

Re:K3s: Kubernetes without the features I don't care about by cyphar on Monday October 01, 2018 @01:19AM (#18110205)
I mean "transparent to the OS" in reference to operating system tooling rather than the kernel objects that make up containers (there is an argument that these are related concepts -- but I think we can have cohesive tooling without redesigning how Linux handles containers). The lack of a 'struct container_t' in Linux definitely makes containers quite complicated to set up, and is a constant source of pain. But this also allows for lots of flexibility with different userspace programs to use various subsets of containers as part of their operation (the Chrome sandbox is a good example of this).

> The is opposed to the container root fs that you call "opaque", supposedly because it cannot be easily mounted from the host OS etc.

Well, you can mount it and you can manually funge with it using 'nsenter' but that's not really ideal. Why (from the perspective of a user) can't you run a package upgrade across your containers? Why can't you get the free memory across all containers? Free disk space? And so on. This information is _available_ but it's not cohesive for _users_.

> VMs on the other hand are in that respect – in a similar way Solaris zones and Jails are

I agree that Solaris Zones and FreeBSD Jails are transparent (in fact that level of tooling transparency is what I wish we had on Linux). I don't agree that VMs are transparent in the same way -- they are an opaque DRAM blob from the perspective of the host kernel. You can dtrace zones/jails, you cannot dtrace a VM (and get meaningful results about what the guest kernel is doing) AFAIK.

Re:K3s: Kubernetes without the features I don't care about by ofrzeta on Thursday October 04, 2018 @03:15AM (#18137844)
> I mean "transparent to the OS" in reference to operating system tooling rather than the kernel objects that make up containers (there is an argument that these are related concepts -- but I think we can have cohesive tooling without redesigning how Linux handles containers). The lack of a 'struct container_t' in Linux definitely makes containers quite complicated to set up, and is a constant source of pain

It makes it difficult to reason about containers, as well. For instance do you see confinement technologies such as AppArmor or SELinux belonging to the container or are they slapped on top of containers? Where do you draw the boundary? And does it make sense to talk about "containers" when it's such a vague concept. Also, there are now "VM containers" such as Kata.

Re:K3s: Kubernetes without the features I don't care about by cyphar on Thursday October 04, 2018 @10:08AM (#18139996)
> And does it make sense to talk about "containers" when it's such a vague concept.

Well at some point we have to be able to talk about the widely-used and glued-together namespaces+cgroups+... concept. "Containers" is a perfectly fine thing to discuss (especially since the history of namespaces was definitely based in more "fully fledged" container technologies like Xen).

> Also, there are now "VM containers" such as Kata.

... which are just VMs that can interact with container tools. I'm pretty sure that most people would not call these "containers" from an OS point of view because they do not share any of the primary properties that containers (or Jails/Zones) have -- the host kernel actually knows what the container processes are doing.

Re:K3s: Kubernetes without the features I don't care about by imhoguy on Thursday September 27, 2018 @01:57AM (#18082361)
There is always systemd-nspawn to do it the simple way.
Re:K3s: Kubernetes without the features I don't care about by cyphar on Thursday September 27, 2018 @06:44AM (#18083336)
systemd-nspawn doesn't really help do any of what I complained about. Besides, LXC is a much better "simple" container runtime in my opinion.
Re:K3s: Kubernetes without the features I don't care about by Carpetsmoker on Wednesday September 26, 2018 @10:42PM (#18081772)
I think pledge (and unveil) are really good ideas, but that doesn't mean it's a substitute for containers. They're kind of different: pledge mostly just enforces correctness of a program, whereas containers enforce separation. I think containers are more analogous to privsep (used extensively in OpenBSD) than pledge.

My biggest issue with the current state is that the common tools (e.g. Docker, k8s) are pretty terrible. Docker overcomplicates a great many things, which is one reason for the many bugs. And k8s ... well, let's not even go there.

I don't think much more is needed than just `run-container /usr/containers/cool-container` and presto, a container with the files in that directory. No need for buggy/slow platform-dependent FS abstraction layers that change every year because they never quite work right in a bazillion edge cases. This is how e.g. FreeBSD jails work.

This won't prevent implementing tools like `docker pull`; at it simplest it could be `curl ... | tar xf - -C /usr/containers/cool-container`. Running multiple containers based of a single image? `cp -r`.

Maybe I'm just an old Unix guy, but I think that composition from generic tools is a much better approach for a lot of this stuff. It's easier, less platform-dependent, has less code (meaning less bugs), etc.

Re:K3s: Kubernetes without the features I don't care about by nwmcsween on Wednesday September 26, 2018 @11:39PM (#18081996)
Containers are basically a few syscalls wrapped in a ball of mud, pledge is containment and the Linux somewhat broken and ugly alternative seccomp bpf is used in most containers _but_ not properly as most containers are bundles of software (multiple binaries) which makes it hard to contain a container (ha) as you have to allow more syscalls than needed. A better way would just use .preinit_array and inject a .seccomp section, .unshare, etc to create per binary containment or just chain-load everything in one big line.
Re:K3s: Kubernetes without the features I don't care about by Carpetsmoker on Thursday September 27, 2018 @12:09AM (#18082071)
> Containers are basically a few syscalls wrapped in a ball of mud

I don't think it has to be; I mean, the current Linux/Docker situation is kind of that, but that's just a single implementation.

> most containers are bundles of software (multiple binaries)

Yeah, exactly. Containers aren't just about security, also convenience. Something like "docker pull someimage" can be a handy cross-platform way to run stuff.

I think "docker pull" is the reason for Docker's popularity. You can build a self-contained container containing Ruby, all your Ruby on Rails stuff and JS stuff, and whatnot, and then send that to any server and just "docker run" it. Getting some of this dynamic stuff to run can be tricky and error-prone: need to get the correct Ruby version, Rails version, muck about with bundle, etc.

Want to add a new app-server or migrate to somewhere else? Need to spend a day setting everything up again and hope you didn't make a mistake that will bite you later :-(

A self-contained container is a lot easier, even with good OS package management or automation tools like Puppet.

Many people also use Docker as "Vagrant" (e.g. to run dev versions or tests and whatnot). Again, "docker pull" is convenient here, especially when there are certain dependencies/requirements, or for running testing against different versions of some dependency, etc.

Again, I don't think Docker is very good as such, but I do think there are some ideas worth keeping, both for security and plain convenience (not often those two go hand-in-hand!)

Re:K3s: Kubernetes without the features I don't care about by barrkel on Wednesday September 26, 2018 @09:18PM (#18081518)
K8s is about cluster orchestration. It's for building apps that allocate memory and compute from a pool of machines almost like malloc() and free(). It's also an abstraction for allocating compute away from the specifics of a provider, so you theoretically don't care if you deploy to gcloud or Azure or AWS. Containers and images merely define the interface with the agnostically allocated compute. They're not the essential bit though, not the magic.
Re:K3s: Kubernetes without the features I don't care about by djsumdog on Wednesday September 26, 2018 @09:28PM (#18081546)
Right, and there are some scheduling systems like Maraton/mesos that can be used to control jobs or VMs as well (although they're more often used with containers than anything else these days). Can K8s run VMs or is its only abstraction containers/pods?
Re:K3s: Kubernetes without the features I don't care about by peteridah on Thursday September 27, 2018 @04:24AM (#18082851)
The pod abstraction can be implemented as a vm. Take a look at clear containers
Re:K3s: Kubernetes without the features I don't care about by dharmab on Wednesday September 26, 2018 @09:32PM (#18081552)
Containers in pods only. In practice we run all of our Mesos tasks and Marathon services in containers anyway, as you mentioned.
Re:K3s: Kubernetes without the features I don't care about by nwmcsween on Wednesday September 26, 2018 @09:35PM (#18081563)
I never said K8s wasn't about orchestration, I said why push containers in their current horribly broken form