systemd in Containers Tokyo, Japan
June 2015
systemd in Containers Docker, Rocket, LXC, libvirt-lxc, OpenVZ, . . . systemd-nspawn + systemd-machined + systemd-importd
Containers
systemd in Containers systemd-nspawn + systemd-machined + systemd-importd
Containers Docker, Rocket, LXC, libvirt-lxc, OpenVZ, . . .
systemd in Containers systemd-machined + systemd-importd
Containers Docker, Rocket, LXC, libvirt-lxc, OpenVZ, . . . systemd-nspawn +
systemd in Containers systemd-importd
Containers Docker, Rocket, LXC, libvirt-lxc, OpenVZ, . . . systemd-nspawn + systemd-machined +
systemd in Containers Containers Docker, Rocket, LXC, libvirt-lxc, OpenVZ, . . . systemd-nspawn + systemd-machined + systemd-importd
systemd in Containers Inspiration: Solaris Zones OS running inside the container similar to OS outside of the container “Integrated Isolation” Features that container systems provide, should also be available on the host system
Containers as a part of the OS concept itself
systemd in Containers OS running inside the container similar to OS outside of the container “Integrated Isolation” Features that container systems provide, should also be available on the host system
Containers as a part of the OS concept itself Inspiration: Solaris Zones
systemd in Containers “Integrated Isolation” Features that container systems provide, should also be available on the host system
Containers as a part of the OS concept itself Inspiration: Solaris Zones OS running inside the container similar to OS outside of the container
systemd in Containers Features that container systems provide, should also be available on the host system
Containers as a part of the OS concept itself Inspiration: Solaris Zones OS running inside the container similar to OS outside of the container “Integrated Isolation”
systemd in Containers Containers as a part of the OS concept itself Inspiration: Solaris Zones OS running inside the container similar to OS outside of the container “Integrated Isolation” Features that container systems provide, should also be available on the host system
systemd in Containers Focus is on getting the low-level parts right No hacks! Clean, integrated implementation matters for us btrfs, no LVM Defined execution environment that is close to what we expect for the host OS Open doors for alternatives
Minimal
systemd in Containers No hacks! Clean, integrated implementation matters for us btrfs, no LVM Defined execution environment that is close to what we expect for the host OS Open doors for alternatives
Minimal Focus is on getting the low-level parts right
systemd in Containers btrfs, no LVM Defined execution environment that is close to what we expect for the host OS Open doors for alternatives
Minimal Focus is on getting the low-level parts right No hacks! Clean, integrated implementation matters for us
systemd in Containers Defined execution environment that is close to what we expect for the host OS Open doors for alternatives
Minimal Focus is on getting the low-level parts right No hacks! Clean, integrated implementation matters for us btrfs, no LVM
systemd in Containers Open doors for alternatives
Minimal Focus is on getting the low-level parts right No hacks! Clean, integrated implementation matters for us btrfs, no LVM Defined execution environment that is close to what we expect for the host OS
systemd in Containers Minimal Focus is on getting the low-level parts right No hacks! Clean, integrated implementation matters for us btrfs, no LVM Defined execution environment that is close to what we expect for the host OS Open doors for alternatives
systemd in Containers We test systemd itself daily in a container. In fact, we test it more often in a container than on bare metal Cluster-wide orchestration is not the focus – But it makes sense to built it on top Rocket makes use of nspawn for the actual containerization
Avoid defining new standards where there already are standards
systemd in Containers Cluster-wide orchestration is not the focus – But it makes sense to built it on top Rocket makes use of nspawn for the actual containerization
Avoid defining new standards where there already are standards We test systemd itself daily in a container. In fact, we test it more often in a container than on bare metal
systemd in Containers – But it makes sense to built it on top Rocket makes use of nspawn for the actual containerization
Avoid defining new standards where there already are standards We test systemd itself daily in a container. In fact, we test it more often in a container than on bare metal Cluster-wide orchestration is not the focus
systemd in Containers Rocket makes use of nspawn for the actual containerization
Avoid defining new standards where there already are standards We test systemd itself daily in a container. In fact, we test it more often in a container than on bare metal Cluster-wide orchestration is not the focus – But it makes sense to built it on top
systemd in Containers Avoid defining new standards where there already are standards We test systemd itself daily in a container. In fact, we test it more often in a container than on bare metal Cluster-wide orchestration is not the focus – But it makes sense to built it on top Rocket makes use of nspawn for the actual containerization
systemd in Containers Any container or VM manager can register its machines with it Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . . Integration with ps, gnome-system-monitor, . . . systemd-run -M, machinectl login, machinectl stop, . . . Automatic host name resolution (using nss-mycontainers) sd-bus D-Bus API is container-aware
machinectl + systemd-machined
systemd in Containers Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . . Integration with ps, gnome-system-monitor, . . . systemd-run -M, machinectl login, machinectl stop, . . . Automatic host name resolution (using nss-mycontainers) sd-bus D-Bus API is container-aware
machinectl + systemd-machined Any container or VM manager can register its machines with it
systemd in Containers Integration with ps, gnome-system-monitor, . . . systemd-run -M, machinectl login, machinectl stop, . . . Automatic host name resolution (using nss-mycontainers) sd-bus D-Bus API is container-aware
machinectl + systemd-machined Any container or VM manager can register its machines with it Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . .
systemd in Containers systemd-run -M, machinectl login, machinectl stop, . . . Automatic host name resolution (using nss-mycontainers) sd-bus D-Bus API is container-aware
machinectl + systemd-machined Any container or VM manager can register its machines with it Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . . Integration with ps, gnome-system-monitor, . . .
systemd in Containers Automatic host name resolution (using nss-mycontainers) sd-bus D-Bus API is container-aware
machinectl + systemd-machined Any container or VM manager can register its machines with it Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . . Integration with ps, gnome-system-monitor, . . . systemd-run -M, machinectl login, machinectl stop, . . .
systemd in Containers sd-bus D-Bus API is container-aware
machinectl + systemd-machined Any container or VM manager can register its machines with it Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . . Integration with ps, gnome-system-monitor, . . . systemd-run -M, machinectl login, machinectl stop, . . . Automatic host name resolution (using nss-mycontainers)
systemd in Containers machinectl + systemd-machined Any container or VM manager can register its machines with it Integration with systemctl -M, systemctl -r, systemctl list-machines, loginctl -M, journalctl -M, journalctl -m, . . . Integration with ps, gnome-system-monitor, . . . systemd-run -M, machinectl login, machinectl stop, . . . Automatic host name resolution (using nss-mycontainers) sd-bus D-Bus API is container-aware
systemd in Containers Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service, literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn
systemd in Containers You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service, literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn Minimal container manager, integrates with systemd-machined
systemd in Containers Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service, literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it
systemd in Containers Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service, literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines
systemd in Containers Container-as-a-service, literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks
systemd in Containers , literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service
systemd in Containers Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd-nspawn Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service, literally: [email protected]
systemd in Containers systemd-nspawn Minimal container manager, integrates with systemd-machined You pass it a directory, and it will boot it Preferred container directory is /var/lib/machines Also, disassembles GPT partition tables, and boots raw disks Container-as-a-service, literally: [email protected] Resource Management like for normal services: systemctl set-propery [email protected] CPUShares=100
systemd in Containers Container support by default: When run on host, when a new veth tunnel to a container appears, automatically picks an unused IP range for it, and runs a DHCP server on it, as well as IPv4LL, configure IP Masquerading. When run in container, and it sees a tunnel to the host, automatically runs a DHCP client on it, as well as IPv4LL.
systemd-networkd
systemd in Containers When run on host, when a new veth tunnel to a container appears, automatically picks an unused IP range for it, and runs a DHCP server on it, as well as IPv4LL, configure IP Masquerading. When run in container, and it sees a tunnel to the host, automatically runs a DHCP client on it, as well as IPv4LL.
systemd-networkd Container support by default:
systemd in Containers When run in container, and it sees a tunnel to the host, automatically runs a DHCP client on it, as well as IPv4LL.
systemd-networkd Container support by default: When run on host, when a new veth tunnel to a container appears, automatically picks an unused IP range for it, and runs a DHCP server on it, as well as IPv4LL, configure IP Masquerading.
systemd in Containers systemd-networkd Container support by default: When run on host, when a new veth tunnel to a container appears, automatically picks an unused IP range for it, and runs a DHCP server on it, as well as IPv4LL, configure IP Masquerading. When run in container, and it sees a tunnel to the host, automatically runs a DHCP client on it, as well as IPv4LL.
systemd in Containers Register host name by default via LLMNR, regardless if run in container or host. LLMNR name lookups by default systemd-networkd + systemd-resolved in container and on host: connectivity just works, with name resolution both ways.
systemd-resolved
systemd in Containers LLMNR name lookups by default systemd-networkd + systemd-resolved in container and on host: connectivity just works, with name resolution both ways.
systemd-resolved Register host name by default via LLMNR, regardless if run in container or host.
systemd in Containers systemd-networkd + systemd-resolved in container and on host: connectivity just works, with name resolution both ways.
systemd-resolved Register host name by default via LLMNR, regardless if run in container or host. LLMNR name lookups by default
systemd in Containers systemd-resolved Register host name by default via LLMNR, regardless if run in container or host. LLMNR name lookups by default systemd-networkd + systemd-resolved in container and on host: connectivity just works, with name resolution both ways.
systemd in Containers Import container images from the Internet or locally, export them locally. Formats: .tar or .raw (also, import-only: dkr) machinectl pull-raw –verify=no http://ftp.halifax.rwth- aachen.de/fedora/linux/releases/21/Cloud/Images/x86 64/Fedora- Cloud-Base-20141203-21.x86 64.raw.xz systemd-nspawn -M Fedora-Cloud-Base-20141203-21
systemd-importd
systemd in Containers Formats: .tar or .raw (also, import-only: dkr) machinectl pull-raw –verify=no http://ftp.halifax.rwth- aachen.de/fedora/linux/releases/21/Cloud/Images/x86 64/Fedora- Cloud-Base-20141203-21.x86 64.raw.xz systemd-nspawn -M Fedora-Cloud-Base-20141203-21
systemd-importd Import container images from the Internet or locally, export them locally.
systemd in Containers machinectl pull-raw –verify=no http://ftp.halifax.rwth- aachen.de/fedora/linux/releases/21/Cloud/Images/x86 64/Fedora- Cloud-Base-20141203-21.x86 64.raw.xz systemd-nspawn -M Fedora-Cloud-Base-20141203-21
systemd-importd Import container images from the Internet or locally, export them locally. Formats: .tar or .raw (also, import-only: dkr)
systemd in Containers systemd-nspawn -M Fedora-Cloud-Base-20141203-21
systemd-importd Import container images from the Internet or locally, export them locally. Formats: .tar or .raw (also, import-only: dkr) machinectl pull-raw –verify=no http://ftp.halifax.rwth- aachen.de/fedora/linux/releases/21/Cloud/Images/x86 64/Fedora- Cloud-Base-20141203-21.x86 64.raw.xz
systemd in Containers systemd-importd Import container images from the Internet or locally, export them locally. Formats: .tar or .raw (also, import-only: dkr) machinectl pull-raw –verify=no http://ftp.halifax.rwth- aachen.de/fedora/linux/releases/21/Cloud/Images/x86 64/Fedora- Cloud-Base-20141203-21.x86 64.raw.xz systemd-nspawn -M Fedora-Cloud-Base-20141203-21
systemd in Containers Make /usr sufficient to boot up system Boot once with empty /etc and/or /var for factory reset Boot each time with empty /etc and/or /var for stateless systems Mount the same /usr into many systems, for golden master systems, with central updating systemd-nspawn –volatile=
Stateless Systems:
systemd in Containers Boot once with empty /etc and/or /var for factory reset Boot each time with empty /etc and/or /var for stateless systems Mount the same /usr into many systems, for golden master systems, with central updating systemd-nspawn –volatile=
Stateless Systems: Make /usr sufficient to boot up system
systemd in Containers Boot each time with empty /etc and/or /var for stateless systems Mount the same /usr into many systems, for golden master systems, with central updating systemd-nspawn –volatile=
Stateless Systems: Make /usr sufficient to boot up system Boot once with empty /etc and/or /var for factory reset
systemd in Containers Mount the same /usr into many systems, for golden master systems, with central updating systemd-nspawn –volatile=
Stateless Systems: Make /usr sufficient to boot up system Boot once with empty /etc and/or /var for factory reset Boot each time with empty /etc and/or /var for stateless systems
systemd in Containers systemd-nspawn –volatile=
Stateless Systems: Make /usr sufficient to boot up system Boot once with empty /etc and/or /var for factory reset Boot each time with empty /etc and/or /var for stateless systems Mount the same /usr into many systems, for golden master systems, with central updating
systemd in Containers Stateless Systems: Make /usr sufficient to boot up system Boot once with empty /etc and/or /var for factory reset Boot each time with empty /etc and/or /var for stateless systems Mount the same /usr into many systems, for golden master systems, with central updating systemd-nspawn –volatile=
systemd in Containers machinectl clone machinectl set-limit machinectl copy-from machinectl copy-to machinectl bind
Assorted features:
systemd in Containers machinectl set-limit machinectl copy-from machinectl copy-to machinectl bind
Assorted features: machinectl clone
systemd in Containers machinectl copy-from machinectl copy-to machinectl bind
Assorted features: machinectl clone machinectl set-limit
systemd in Containers machinectl copy-to machinectl bind
Assorted features: machinectl clone machinectl set-limit machinectl copy-from
systemd in Containers machinectl bind
Assorted features: machinectl clone machinectl set-limit machinectl copy-from machinectl copy-to
systemd in Containers Assorted features: machinectl clone machinectl set-limit machinectl copy-from machinectl copy-to machinectl bind
systemd in Containers systemd-nspawn –ephemeral systemd-nspawn –port=
Assorted features II:
systemd in Containers systemd-nspawn –port=
Assorted features II: systemd-nspawn –ephemeral
systemd in Containers Assorted features II: systemd-nspawn –ephemeral systemd-nspawn –port=
systemd in Containers That’s all, folks!
systemd in Containers