Running Flatcar on STACKIT
STACKIT Cloud
is a european business cloud provider.
This guide shows you how to run Flatcar Container Linux on STACKIT Cloud by uploading a custom image and creating a server instance with it.
These instructions require Flatcar with version 4230.2.1 or newer.
Prerequisites
Before you start, ensure you have the following:
- A STACKIT account, organization, and a project.
- The STACKIT CLI installed and configured on your machine.
Before you start, make sure to define all environment variables in order to reuse them in the next steps:
|
|
Load these with source flatcar.env
Step 1: Upload the Flatcar image
First, upload your desired Flatcar image to your STACKIT project.
|
|
You can verify the upload by listing all available images in your project:
|
|
Step 2: Prepare the server environment
Before creating the server, you need to prepare several components: an SSH key for access, a network for connectivity, a security group with a rule to allow SSH, and a public IP address.
1. Create an SSH key
If you don’t have one already, upload your public SSH key to STACKIT. This allows you to securely access your server later.
|
|
2. Create a network
Your server needs to be attached to a network.
|
|
3. Create a security group and rule
First, create the security group that will contain the firewall rules.
|
|
Next, add a rule to it to allow incoming SSH traffic on port 22.
|
|
4. Create a public IP address
Create a public IP address that you will later attach to the server.
|
|
Get the IP address you created.
|
|
5. (Optional) Automatic configuration with Butane and User Data
You can automatically configure your Flatcar Container Linux instances on first boot using Butane configs. Butane is a user-friendly tool that generates a final Ignition configuration file used by the booting machine.
On STACKIT, you provide this final configuration to your server via the User Data field.
5.1 Create the Butane file
As an example, create a file named butane.yaml that starts an Nginx container and displays the instance hostname:
|
|
5.2 Convert Butane to Ignition
This Butane file must be converted into an Ignition file (ignition.json) before use:
|
|
Step 3: Create and access the server
Now you have all the necessary components to create your Flatcar server.
1. Create the server
Create your server with all resources you created above.
|
|
If you created an Ignition file, include the additional --user-data @/path/to/your/ignition.json flag.
Make sure to use the @ prefix, which tells the CLI to load the contents of your Ignition file.
2. Attach a public IP
Then, attach the IP to your server:
|
|
3. Connect to your server
Your Flatcar server is running and your public IP address is attached.
You can now connect to it via SSH using the user core and your private SSH key.
|
|
4. (Optional) Verify your nginx configuration
If you configured the server with the example Butane file to run an Nginx container, you can verify that it’s working after you have connected via SSH.
Run the curl command to check the local web server:
|
|
This confirms your User Data script was executed successfully. You should see a “Hello” message from the container, which includes the server’s unique hostname:
|
|