Running Flatcar Container Linux on OpenStack
These instructions will walk you through downloading Flatcar Container Linux for OpenStack, importing it with the glance tool, and running your first cluster with the nova tool.
Import the image
These steps will download the Flatcar Container Linux image, uncompress it, and then import it into the glance image store.
Choosing a channel
Flatcar Container Linux is designed to be updated automatically with different schedules per channel. You can disable this feature , although we don’t recommend it. Read the release notes for specific features and bug fixes.
The Alpha channel closely tracks master and is released frequently. The newest versions of system libraries and utilities will be available for testing. The current version is Flatcar Container Linux 4628.0.0.
$ wget https://alpha.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img.bz2 $ bunzip2 flatcar_production_openstack_image.img.bz2
The Beta channel consists of promoted Alpha releases. The current version is Flatcar Container Linux 4593.1.0.
$ wget https://beta.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img.bz2 $ bunzip2 flatcar_production_openstack_image.img.bz2
The Stable channel should be used by production clusters. Versions of Flatcar Container Linux are battle-tested within the Beta and Alpha channels before being promoted. The current version is Flatcar Container Linux 4459.2.4.
$ wget https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img.bz2 $ bunzip2 flatcar_production_openstack_image.img.bz2
Once the download completes, add the Flatcar Container Linux image into Glance:
|
|
The hw_qemu_guest_agent=yes property is optional, but recommended: it enables the qemu guest agent on instances booted from this image which improves lifecycle operations — such as reboots, shutdowns or backup/snapshots commands.
Optionally add the --visibility public flag to make this image available outside of the configured OpenStack account tenant. See the
openstack-cli docs
for additional options and flags.
Butane Configs
Flatcar Container Linux allows you to configure machine parameters, launch systemd units on startup and more via Butane Configs. These configs are then transpiled into Ignition JSON configs and given to booting machines. Jump over to the docs to learn about the supported features . We’re going to provide our Butane Config to OpenStack via the user-data flag. Our Butane Config will also contain SSH keys that will be used to connect to the instance. In order for this to work your OpenStack cloud provider must support config drive or the OpenStack metadata service.
As an example, this Butane YAML config will start an NGINX Docker container:
|
|
Transpile it to Ignition JSON:
|
|
The coreos-metadata.service saves metadata variables to /run/metadata/flatcar. Systemd units can use them with EnvironmentFile=/run/metadata/flatcar in the [Service] section when setting Requires=coreos-metadata.service and After=coreos-metadata.service in the [Unit] section.
Unfortunately systems relying on config drive are currently unsupported.
Launch cluster
Boot the machines with the openstack CLI, referencing the image ID from the import step above and your
Ignition file from butane
:
|
|
To use config drive you may need to add --use-config-drive to command above.
If you have more than one network, you may have to be explicit in the openstack server create command.
|
|
You can see the IDs for your configured networks by running
|
|
Your first Flatcar Container Linux cluster should now be running. The only thing left to do is find an IP and SSH in.
|
|
Finally SSH into an instance, note that the user is core:
|
|
Adding more machines
Adding additional instances to the cluster is as easy as launching more with the same Butane Config. New instances will join the cluster assuming they can communicate with the others.
Example:
|
|
Using Flatcar Container Linux
Now that you have a machine booted it is time to play around. Check out the Flatcar Container Linux Quickstart guide or dig into more specific topics .