Skip to main content

Cluster-Level Container Deployment with fleet

Today I'd like to introduce our latest project, fleet. fleet builds on etcd and systemd to provide a distributed, fault-tolerant platform for deploying applications on CoreOS clusters.

The Basics

With fleet, you can treat your CoreOS cluster as if it shared a single init system. It encourages users to write applications as small, ephemeral units that can easily migrate around a cluster of self-updating CoreOS machines.


User job requests kick off a bidding process by the machines in the cluster. Based on the received bids the engine assigns the job to a machine. This process relies on two of etcd's key features: directory watch events and cluster-level locks. During the life of a job an event-driven architecture allows the cluster to react to membership changes and service state changes in real-time.

Read more about the architecture on GitHub.

So… what can it actually do?

  • Deploy docker containers on arbitrary hosts in a cluster
  • Distribute services across a cluster using machine-level anti-affinity
  • Maintain N instances of a service, re-scheduling on failure
  • Discover machines running in the cluster
  • Automatically SSH into the machine running a job


The API keys used in this video were revoked before it was posted — free AWS isn't a feature of CoreOS. Below are the systemd units used in the demo:



ExecStartPre=-/usr/bin/docker kill subgun-1
ExecStartPre=-/usr/bin/docker rm subgun-1
ExecStart=/usr/bin/docker run -rm -name subgun-1 -e SUBGUN_LISTEN= -e -e SUBGUN_API_KEY=key-779ru4cibbnhfa1qp7a3apyvwkls7ny7 -p 8080:8080 coreos/subgun
ExecStop=/usr/bin/docker kill subgun-1


GitHub RepoDocker Index


Description=subgun presence service

ExecStartPre=-/usr/bin/docker kill subgun-presence-1
ExecStartPre=-/usr/bin/docker rm subgun-presence-1
ExecStart=/usr/bin/docker run -rm -name subgun-presence-1 -e AWS_ACCESS_KEY=AKIAIBC5MW3ONCW6J2XQ -e AWS_SECRET_KEY=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 -e AWS_REGION=us-east-1 -e ELB_NAME=bcwaldon-fleet-lb
ExecStop=/usr/bin/docker kill subgun-presence-1


GitHub RepoDocker Image on

Get up and running

fleet is available in CoreOS version 231.0.0 and newer. Get an etcd cluster up and running and simply call systemctl start fleet. You can then interact with your fleet cluster using the fleetctl command line tool available from GitHub. Binaries are available for both Linux and OS X.


We have an AWS CloudFormation template that uses the new etcd cluster discovery protocol to provide autoscaled CoreOS clusters. Check it out on our EC2 docs.

Fleet + CloudFormation
Step 1 of a new CloudFormation stack.

Learn More

All documentation is located within the GitHub repo. Learn more about using the fleetctl client, deployment and configuration, system architecture and more.