“I just want to run a container”
jvns.ca
jvns.ca
They're not VMs in the sense that none of the tried and true methods for orchestrating VMs is available. You need new solutions for networking, new solutions for storage, new failover patterns, new tools for clustering and organizing them, new application patterns, etc. Basically all the stuff that would have been handled by the hypervisor and the software defined networking layer is now all of a sudden in your face and you need some way to deal with it.
It's been possible since before either of these existed. There are several container and orchestration systems that predate both.
My own pet faves are Garden (née Warden) and Diego, but that's probably because I work at the company (Pivotal) where they were born.
> let's say all my 50 containers share a bunch of files
(shared libraries like libc, Ruby gems, a base operating
system, etc.). It would be nice if I could load all those
files into memory just once, instead of 3 times.
Correct me if I'm wrong, but doesn't this kind of situation seem like a poor use-case of containers? It seems to me that one of the main points of containerization is to encapsulate the runtime dependencies of a process. If you're conflating that by making two containers depend on the same runtime objects then the point of containerization has been lost. You might as well go back to a virtual machine. That's not to suggest that there are not circumstances where overlay networks and filesystems aren't useful, just that you should not be using them to manage dependencies.Under this architecture, what happens when I want to update my applications to use a new version of a shared library? I either am forced to update all of my applications at once or I must modify the architecture and remove that shared dependency. This breaks down the composition that containerization promises.
I think that this advice should be re-examined. I am by no means an expert, but this doesn't seem smart to me...
[0] https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-f...
Personal opinion: If you're already using systemd on the host, nspawn containers are trivially easy to create, boot, and maintain. Running systemd as the guest init allows you to use `systemctl -M <machine>` and `journalctl -M <machine>` the same way you would for the host, and the guest process tree is exposed in the host's `systemctl status`.
But yea, first look, it seems usefull :-)
- I can use the same tools to administer both host and guests (systemctl and journalctl).
- cgroups and namespaces are managed the same way on both host and guests.
- I can integrate containers (via .nspawn and .service units) with my host init/supervision daemon, like any other systemd service, without translating from one configuration format to another.
- Because of the above, resource/quota constraints for a single container or groups of containers can be described via a common configuration.
I see the top comment (dkarapetyan) mentions it, but you never really read of blogposts discussing how they scaled their LXC containers, etc.
BTW there's a cool feature called Kernel Samepage Merging [1] that was created for the sake of conserving memory consumed in virtualization or container use cases like this.
systemd-nspawn --template="/path/to/subvolume" <other args>
This creates a copy-on-write snapshot of the subvolume you supply, which is instantaneous. The --ephemeral flag can be used instead if you want the guest to be able to modify the base filesystem but you do not want those changes to persist across container boots.Can someone describe what advantages rkt gives you over plain nspawn containers?
I'm not software architect, but when I see this, it seems to me that something deeply wrong with implementation or with technology itself.