Installing CoreOS

From BitFolk
Jump to: navigation, search

Some instructions on using CoreOS at BitFolk.

Installation

You'll want to use the "installing to disk" instructions from the Rescue VM, but specifying the "xen" OEM provider. So that's something like:

$ ./coreos-install -d /dev/xvda -o xen

However, that would result in a host that you have no way to log in to, as CoreOS by default has only accounts with locked passwords. Enter Cloud Config.

Cloud Config

You can use a Cloud Config file to configure many things about your CoreOS host. To start with, an SSH key for you to log in with and an IP address to connect to.

The Cloud Config is a YAML file. Here's an example:

#cloud-config

# Include my SSH public key.
ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGdByTgSVHq.......

# Set a static IP address.
coreos:
    units:
        - name: 00-eth0.network
          runtime: true
          content: |
            [Match]
            Name=eth0

            [Network]
            DNS=85.119.80.232
            Address=85.119.82.121
            Gateway=85.119.80.1

As you can see this just defines a systemd unit for configuring eth0. Consult the documentation for more complicated configurations.

It's important that you get your cloud-init.yaml right as a syntax error will probably leave you with something that you can't log in to and have to just overwrite. It can be useful to paste your YAML into their validator to check it's at least syntactically-correct.

Assuming you saved that as cloud-init.yaml you'd install your image to disk like:

$ ./coreos-install -d /dev/xvda -o xen -c cloud-init.yaml

Booting

Halt the rescue VM and boot from the Xen Shell. It now boots in to CoreOS. You can connect to it with SSH as the core user, using the SSH public key you installed.