Launching Containers with fleet
Launching Containers with fleet fleet is a cluster manager that controls systemd at the cluster level. To run your services in the cluster, you must submit regular systemd units combined with a few fleet-specific properties. If you’re not familiar with systemd units, check out our Getting Started with systemd guide. This guide assumes you’re running fleetctl locally from a CoreOS machine that’s part of a CoreOS cluster. You can also control your cluster remotely. All of the units referenced in this blog
Source: Launching Containers with fleet
Here is the second in the series of gearing up for kubernetes. I wanted to learn how systemd and fleet work together to get container spread throughout a cluster. If you understand how containers run in docker (required reading) then you should see the power of this simple toolset.
First we build a service file (a unit). The service file is essentially a case statement with pre-reqs and conditionals. If you have ever started or stopped a service on a linux client, then its easy to link what this service file does. It is essentially building a linux service. Instead of the service running other binaries (which it can do also), it executes docker commands (kill, rm, pull, run).
When you are finished writing a service, you use fleet to distribute it. Either you ask fleet to spawn 1 or more of the service anywhere it likes, or you can instruct fleet to filter where it runs based on metadata retrieved from the machines that are in the CoreOS cluster. In addition to this control feature, you can create a global service and when run it will spread out onto each of the machines in the cluster; providing high availability.
Neat, simple and powerful. I am going to move onto playing with rkt (rocket) next. Stay tuned.