Running CoreOS Container Linux on NIFTY Cloud

NIFTY Cloud is a Japanese cloud computing provider. These instructions are also available in Japanese. Before proceeding, you will need to install NIFTY Cloud CLI.

Cloud-config

Container Linux allows you to configure machine parameters, launch systemd units on startup and more via cloud-config. Jump over to the docs to learn about the supported features. Cloud-config is intended to bring up a cluster of machines into a minimal useful state and ideally shouldn't be used to configure anything that isn't standard across many hosts. On NIFTY Cloud, the cloud-config can be modified while the instance is running and will be processed next time the machine boots.

You can provide cloud-config to Container Linux via NIFTY Cloud CLI.

The most common cloud-config for NIFTY Cloud looks like:

 #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
  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 NIFTY Cloud.

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 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 1562.1.0.

Launch via NIFTY Cloud CLI by specifying $ZONE, $TYPE, $FW_ID and $SSH_KEY_ID:

nifty-run-instances $(nifty-describe-images --delimiter ',' --image-name "CoreOS Alpha 1562.1.0" | awk -F',' '{print $2}') --key $SSH_KEY_ID --availability-zone $ZONE --instance-type $TYPE -g $FW_ID -f cloud-config.yml -q POST

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

Launch via NIFTY Cloud CLI by specifying $ZONE, $TYPE, $FW_ID and $SSH_KEY_ID:

nifty-run-instances $(nifty-describe-images --delimiter ',' --image-name "CoreOS Beta 1548.2.0" | awk -F',' '{print $2}') --key $SSH_KEY_ID --availability-zone $ZONE --instance-type $TYPE -g $FW_ID -f cloud-config.yml -q POST

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 1520.6.0.

Launch via NIFTY Cloud CLI by specifying $ZONE, $TYPE, $FW_ID and $SSH_KEY_ID:

nifty-run-instances $(nifty-describe-images --delimiter ',' --image-name "CoreOS Stable 1520.6.0" | awk -F',' '{print $2}') --key $SSH_KEY_ID --availability-zone $ZONE --instance-type $TYPE -g $FW_ID -f cloud-config.yml -q POST

Adding more machines

To add more instances to the cluster, just launch more with the same cloud-config and the appropriate firewall group.

SSH

You can log in your Container Linux instances using:

ssh core@<ip address> -i <path to keyfile>

Using CoreOS Container Linux

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