Running CoreOS Container Linux on VEXXHOST

VEXXHOST is a Canadian OpenStack cloud computing provider based in Canada. In order to get started, you must have an active account on the VEXXHOST public cloud computing service.

The following instructions will walk you through setting up the nova tool with your appropriate credentials and launching your first cluster using the CLI tools.

Choosing a channel

Container Linux is designed to be updated automatically with different schedules per channel. You can disable this feature, although we don't recommend it. Read the release notes for specific features and bug fixes.

The Stable channel should be used by production clusters. Versions of Container Linux are battle-tested within the Beta and Alpha channels before being promoted. The current version is Container Linux 1465.8.0.

The Beta channel consists of promoted Alpha releases. The current version is Container Linux 1520.4.0.

The Alpha channel closely tracks master and is released frequently. The newest versions of system libraries and utilities will be available for testing. The current version is Container Linux 1535.2.0.

Container Linux releases are automatically built and deployed on the VEXXHOST cloud, therefore it is best to launch your clusters with the following naming pattern: CoreOS Channel Version. For example, the image name of the latest alpha release will be "CoreOS Alpha 1535.2.0".

Cloud-config

Container Linux allows you to configure machine parameters, launch systemd units on startup, and more via cloud-config. We're going to provide the cloud-config data via the user-data flag.

At the moment, you cannot supply the user-data using the CloudConsole control panel therefore you must use the CLI to deploy your cluster on the VEXXHOST cloud.

A sample common cloud-config file will look something like the following:

 #cloud-config

coreos:
  etcd2:
    # generate a new token for each unique cluster from https://discovery.etcd.io/new?size=3
    # specify the initial size of your cluster with ?size=X
    discovery: https://discovery.etcd.io/<token>
    # multi-region and multi-cloud deployments need to use $public_ipv4
    advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
    initial-advertise-peer-urls: http://$private_ipv4:2380
    # listen on both the official ports and the legacy ports
    # legacy ports can be omitted if your application doesn't depend on them
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
  units:
    - name: etcd2.service
      command: start
    - name: fleet.service
      command: start
CoreOS cloud-configs can validated using the online validator.

The $private_ipv4 and $public_ipv4 substitution variables are fully supported in cloud-config on VEXXHOST.

Launch cluster

You will need to install python-novaclient which supplies the OpenStack CLI tools as well as a keypair to use in order to access your Container Linux cluster.

Install OpenStack CLI tools

If you don't have pip installed, install it by running sudo easy_install pip. Now let's use pip to install python-novaclient.

$ sudo pip install python-novaclient

Add API credentials

You will need to have your API credentials configured on the machine that you're going to be launching your cluster from. The easiest way to do this is by logging into the CloudConsole control panel and clicking on "API Credentials".

From there, you must create a file on your system with the contents of the openrc file provided. Once done, you will need to source that file in your shell prior to running any API commands. You can test that everything is running properly by running the following command:

$ source openrc
$ nova credentials

Create keypair

You can import an existing public key by using the nova keypair-add command, however for this guide, we will be creating a new keypair and storing the private key for it locally and use it to access our Container Linux cluster.

$ nova keypair-add coreos-key > coreos.pem

Create servers

You should now be ready to launch the servers which will create your Container Linux cluster using the nova CLI command.

The Alpha channel closely tracks master and is released frequently. The newest versions of system libraries and utilities will be available for testing. The current version is Container Linux 1535.2.0.

nova boot --user-data cloud-config.yaml --image "CoreOS Alpha 1535.2.0" --key-name coreos-key --flavor nb.2G --num-instances 3 coreos

The Beta channel consists of promoted Alpha releases. The current version is Container Linux 1520.4.0.

nova boot --user-data cloud-config.yaml --image "CoreOS Beta 1520.4.0" --key-name coreos-key --flavor nb.2G --num-instances 3 coreos

Once that's done, your cluster should be up and running. You can list the created servers and SSH into a server using your private key.

$ nova list
+--------------------------------------+-----------------+--------+------------+-------------+---------------------------------------+
| ID                                   | Name            | Status | Task State | Power State | Networks                              |
+--------------------------------------+-----------------+--------+------------+-------------+---------------------------------------+
| a1df1d98-622f-4f3b-adef-cb32f3e2a94d | coreos-a1df1d98 | ACTIVE | None       | Running     | public=162.253.x.x; private=10.20.x.x |
| db13c6a7-a474-40ff-906e-2447cbf89440 | coreos-db13c6a7 | ACTIVE | None       | Running     | public=162.253.x.x; private=10.20.x.x |
| f70b739d-9ad8-4b0b-bb74-4d715205ff0b | coreos-f70b739d | ACTIVE | None       | Running     | public=162.253.x.x; private=10.20.x.x |
+--------------------------------------+-----------------+--------+------------+-------------+---------------------------------------+
$ nova ssh --login core -i core.pem coreos-a1df1d98
CoreOS (alpha)
core@a1df1d98-622f-4f3b-adef-cb32f3e2a94d ~ $

Adding more machines

Adding new instances to the cluster is as easy as launching more with the same cloud-config. New instances will join the cluster assuming they can communicate with the others.

Multiple clusters

If you would like to create multiple clusters you'll need to generate and use a new discovery token. Change the token value on the etcd discovery parameter in the cloud-config, and boot new instances.

Using CoreOS Container Linux

Now that you have instances booted it is time to play around. Check out the Container Linux Quickstart guide or dig into more specific topics.