In this tutorial I will demonstrate how to deploy CoreOS instances on VULTR and how to make use of Ignition to automate the configuration of your instance.
Once our instance is running we will run a container image to test if everything works.
What is CoreOS and Ignition?
CoreOS is a minimal operating system to run container based workloads and was acquired by RedHat in early 2018.
Ignition is the utility used by Fedora CoreOS and RHEL CoreOS to manipulate disks during the initramfs, this also includes tasks like creating users, configuring authorised keys, paritioning disks, writing files etc.
Launch a CoreOS Instance via the Console
We will deploy this instance via the console so we can do a step-by-step example to see what's all involved.
Once you logon and head over to instances:
Deploy a server and select "Fedora CoreOS":
When you select Fedora CoreOS, you will need to provide a ignition configuration file, and from VULTRs Documentation they provide a snippet:
But as the time of writing, their documentation snippet isn't working as the console seems to expect the format to be in JSON:
To get it to work, format your configuration to JSON:
If you are following along, the json content is provided below:
{
"ignition": {
"version": "3.0.0"
},
"passwd": {
"users": [
{
"groups": [
"docker",
"sudo"
],
"name": "core",
"sshAuthorizedKeys": [
"ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
]
}
]
}
}
To summarize, we will launch our instance with the following configuration:
- Ignition version 3.0.0
- Creating a user named core and add the user to sudo and docker
- Add the provided authorized keys for the core user
Then select your instance size and a name label, the deploy your instance, once your instance is running it should look something like this:
Run a Container on CoreOS
After you SSH to your instance, run a container:
[core@vultr ~]$ docker run --rm -it ruanbekker/containers:echo
Unable to find image 'ruanbekker/containers:echo' locally
echo: Pulling from ruanbekker/containers
6d4237df5285: Pull complete
Digest: sha256:fe06426e77a696aad837ada622f35a643a903147d6fa71a70c3f9df3db2ea0ab
Status: Downloaded newer image for ruanbekker/containers:echo
2022-09-17T06:31:32Z : ping from a478eabb8193 : iteration 1
2022-09-17T06:31:37Z : ping from a478eabb8193 : iteration 2
2022-09-17T06:31:42Z : ping from a478eabb8193 : iteration 3
2022-09-17T06:31:47Z : ping from a478eabb8193 : iteration 4
2022-09-17T06:31:52Z : ping from a478eabb8193 : iteration 5
The source code for the container image can be found on my dockerfiles github repository.
Thank You
Thanks for reading, feel free to check out my website, feel free to subscribe to my newsletter or follow me at @ruanbekker on Twitter.
Linktree: go.ruan.dev/links Patreon: go.ruan.dev/patreon