remote-lab.net learn by doing

Running a Fedora CoreOS OpenStack instance

Fedora CoreOS is a minimal operating system used for running containerized workloads that I’ve been wanting to experiment with for some time. Since my test infra is OpenStack based I’ll document below how to create a Fedora CoreOS OpenStack instance.

Fedora CoreOS

curl -O https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/32.20200629.3.0/x86_64/fedora-coreos-32.20200629.3.0-openstack.x86_64.qcow2.xz
  • Create Glance image
openstack image create \
  --disk-format qcow2 \
  --container-format bare \
  --public \
  --file fedora-coreos-32.20200629.3.0-openstack.x86_64.qcow2 \
  fedora-coreos-32.20200629.3.0
  • Create an ignition config including any custom configuration that we want the instance to apply at boot time. In this example we pass the SSH key for the core user. For more advanced configurations check Ignition documentation
cat fedora_coreos.ign
{
  "ignition": {
    "version": "3.0.0"
  },
  "passwd": {
    "users": [
      {
        "name": "core",
        "sshAuthorizedKeys": [
          "ssh-rsa $YOUR__PUB_KEY“
        ]
      }
    ]
  }
}
  • Create instance
openstack server create 
  --image fedora-coreos-32.20200629.3.0  \
  --flavor m1.small \
  --security-group 49396992-488a-4ecf-acd5-58457aeff1ea \
  --network 6efea6c9-ad41-4a51-ac78-18e3654a779f \
  --user-data ./fedora_coreos.ign \
  --config-drive True \
  fedora_coreos
  • Assign a floating IP to the instance created in the step above
openstack server add floating ip fedora_coreos 172.16.32.103
  • Validate SSH connection to the instance by using the ‘core’ user
ssh [email protected] 'grep PRETTY_NAME /etc/os-release'
PRETTY_NAME="Fedora CoreOS 32.20200629.3.0"
comments powered by Disqus