Skip to content

Commit 9f7d8e3

Browse files
authored
Merge pull request #291 from flatcar/tormath1/brightbox
brightbox: initial commit
2 parents a9b1823 + 3ea83ea commit 9f7d8e3

File tree

3 files changed

+116
-1
lines changed

3 files changed

+116
-1
lines changed

content/docs/latest/_index.md

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ platforms and bare metal servers.
2929
* [DigitalOcean][digital-ocean]
3030
* [Hetzner][hetzner]
3131
* [OpenStack][openstack]
32+
* [Brightbox][brightbox]
3233

3334
#### Virtualization options
3435
It's easy to run a local Flatcar VM on your laptop for testing and debugging
@@ -240,6 +241,7 @@ Flatcar tutorial to deep dive into some Flatcar fundamental concepts.
240241
[sysext]: provisioning/sysext/
241242
[acpi]: setup/customization/ACPI
242243
[openstack]: installing/cloud/openstack
244+
[brightbox]: installing/cloud/brightbox
243245
[kubernetes]: container-runtimes/getting-started-with-kubernetes
244246
[using-nvidia]: setup/customization/using-nvidia
245247
[tutorial-introduction]: tutorial/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: Running Flatcar on Brightbox
3+
linktitle: Running on Brightbox
4+
weight: 10
5+
---
6+
7+
These instructions will walk you through using Flatcar on Brightbox, importing a custom image, and running your first server using the command line interface. Please note that Brightbox is compatible with OpenStack: it is not a mistake if we refer to OpenStack images and specific variables.
8+
9+
## Import the image
10+
11+
While [Brightbox][brightbox] provides Flatcar images for Beta, Stable and LTS channels it is possible to import your own Flatcar image in Brightbox using the [CLI][cli].
12+
13+
For example, to upload an image from the Flatcar Alpha channel:
14+
15+
```bash
16+
$ brightbox images register \
17+
--arch=x86_64 --name=flatcar-alpha \
18+
--url=https://alpha.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img
19+
$ brightbox images list --type=upload
20+
id owner type created_on status size name
21+
---------------------------------------------------------------------------------
22+
img-xoufd acc-jg5aa upload 2023-12-05 private 8694 flatcar-alpha (x86_64)
23+
---------------------------------------------------------------------------------
24+
```
25+
26+
## Butane Configs
27+
28+
Flatcar 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][butane-configs]. We're going to provide our Butane Config to Brightbox via the user-data flag. Our Butane Config will also contain SSH keys that will be used to connect to the instance.
29+
30+
As an example, this Butane YAML config will start an Nginx Docker container and display the instance hostname:
31+
32+
```yaml
33+
variant: flatcar
34+
version: 1.0.0
35+
passwd:
36+
users:
37+
- name: core
38+
ssh_authorized_keys:
39+
- ssh-rsa ABCD...
40+
storage:
41+
directories:
42+
- path: /var/www
43+
systemd:
44+
units:
45+
- name: nginx.service
46+
enabled: true
47+
contents: |
48+
[Unit]
49+
Description=NGINX example
50+
After=docker.service coreos-metadata.service
51+
Requires=docker.service coreos-metadata.service
52+
[Service]
53+
EnvironmentFile=/run/metadata/flatcar
54+
TimeoutStartSec=0
55+
ExecStartPre=-/usr/bin/docker rm --force nginx1
56+
ExecStartPre=-/usr/bin/bash -c "echo 'Hello from ${COREOS_OPENSTACK_HOSTNAME}' > /var/www/index.html"
57+
ExecStart=/usr/bin/docker run --name nginx1 --volume "/var/www:/usr/share/nginx/html:ro" --pull always --log-driver=journald --net host docker.io/nginx:1
58+
ExecStop=/usr/bin/docker stop nginx1
59+
Restart=always
60+
RestartSec=5s
61+
[Install]
62+
WantedBy=multi-user.target
63+
```
64+
65+
Transpile it to Ignition JSON:
66+
67+
```bash
68+
cat butane.yaml | docker run --rm -i quay.io/coreos/butane:release > ignition.json
69+
```
70+
71+
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.
72+
73+
## Launch machine
74+
75+
Boot the machines with the CLI, referencing the image ID from the import step above or using an official image ID (`brightbox images list --type=official`) and your [Ignition file from Butane][butane-configs]:
76+
77+
```shell
78+
$ brightbox servers create --cloud-ip=true --user-data-file=./ignition.json img-xoufd
79+
```
80+
81+
Your first Flatcar instance should now be running. The only thing left to do is find the IP address and SSH in.
82+
83+
```shell
84+
$ brightbox servers show $THE_INSTANCE_ID
85+
...
86+
cloud_ipv4s: 109.107.37.145
87+
...
88+
```
89+
90+
Finally SSH into an instance, note that the user is `core`:
91+
92+
```shell
93+
$ curl 109.107.37.145
94+
Hello from srv-f0lo3.gb1.brightbox.com
95+
96+
core@srv-f0lo3 ~ $ systemctl status nginx
97+
● nginx.service - NGINX example
98+
Loaded: loaded (/etc/systemd/system/nginx.service; enabled; preset: enabled)
99+
Active: active (running) since Tue 2023-12-05 16:25:06 UTC; 1min 53s ago
100+
...
101+
```
102+
103+
:warning: In the following example, the default firewall policy created during account registration has been used, which permits access to TCP ports 22 and 80. If you've modified the default firewall policy then you may need to take additional steps to open access. Here’s the documentation to update the firewall policies: https://www.brightbox.com/docs/guides/cli/firewall/
104+
105+
## Using Flatcar Container Linux
106+
107+
Now that you have a machine booted it is time to play around. Check out the [Flatcar Container Linux Quickstart][quickstart] guide or dig into [more specific topics][doc-index].
108+
109+
[butane-configs]: ../../provisioning/config-transpiler
110+
[brightbox]: https://cloud.brightbox.com/
111+
[cli]: https://www.brightbox.com/docs/reference/cli
112+
[doc-index]: ../../
113+
[quickstart]: ../

content/docs/latest/installing/cloud/openstack.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Unfortunately systems relying on config drive are currently unsupported.
126126

127127
## Launch cluster
128128

129-
Boot the machines with the `nova` CLI, referencing the image ID from the import step above and your [JSON file from ct][cl-configs]:
129+
Boot the machines with the `nova` CLI, referencing the image ID from the import step above and your [Ignition file from butane][butane-configs]:
130130

131131
```shell
132132
nova boot \

0 commit comments

Comments
 (0)