CoreOS

Requirements:
  • You have an account at console.online.net
  • You have a Dedibox dedicated server
  • You have installed it with CoreOS from the management console

CoreOS is a distribution that includes by default several utilities that allow you the deployment of containers using Docker.

Connection

After the installation's end, you'll be able to connect to the server by using ssh with the user core and the SSH key you have indicated during the installation. The user core does not have a password by default

$ ssh <userid>@sd-xxxxx.dedibox.fr

You can also connect you with the user you have specified during the installation using the same ssh key or password.

You'll be able to obtain the rights of the user root with the command sudo.

Management of packages

CoreOS does not have a packet manager, but a toolbox that allows you to get a container based on Fedora, with all the rights on the system and a package manager: yum.

The file system is read only and only the folder /media/root/ is mounted for writing.

The packages that you install using toolbox are not installed on the system, but remain accessible using the command toolbox.

For more information: Install Debugging Tools

Edit of cloud-config

The installation and configuration of CoreOS is done mainly with the file cloud-config.yaml which is parsed on each start of CoreOS.

It is possible to edit the file cloud-config after the installation to modify the configuration of CoreOS.

The file is located at the following path: /var/lib/coreos-install/user_data

CoreOS supports vi and vim as text editors, you can use another by using the command toolbox (see above).

For more information about cloud-config.yaml: Using Cloud-Config

It is recommended to verify the yaml file after editing: Cloud-Config Validator

Configuration of the network

The network interfaces are configured automatically using DHCP.

The public IP of your server is configured by default with the interface eno1 and your RPN address at eno2, if you have configured one. The RPN interface is automatically configured during the installation of your server and no modification has to be made.

The network configuration can be configured using the tool networkd.

You can find more information in the documentation of CoreOS as well in the documentation of nerworkd.

Updates

The customers ofManaged Linux have access to CoreUpdate.

Without CoreUpdate the updates are automatic, CoreOS uses Omaha to apply the updates on another partition. On reboot the system will boot on the new partition or on the old one, in case of a problem.

By default, CoreOS apply the updates and reboot when necessary. It is possible to change CoreOS update behaviour by editing the cloud-config file (see above) or by editing the file /etc/coreos/update.conf if no configuration update is present in the cloud-config file (which is the default).

  • GROUP=stable

This option allows you to change the branch: stable, beta or alpha to perform tests.

  • REBOOT_STRATEGY=best-effort

This option allows you to change the strategy after an update of CoreOS. The available options are: best-effort (default), etcd-lock, reboot or off (disables the automatic reboot).

To activate your changes, you need to restart the service using the following command:

$ sudo systemctl restart update-engine

For more information: Update Strategies, Our Update Philosophy, Switching Release Channels

Clusters

The advantage of CoreOS is the easy configuration of clusters of several servers.

The example given here will be setup by changing the cloud-config file (see above).

It is strongly recommended that you configure your RPN interfaces so that your cluster machines communicate with each other on the private network, otherwise it will be necessary to secure connections to DCE for more information: Reading and Writing over HTTPS.

At first you need a synchronization token, you can get it with the following command:

$ curl -w "\n" https://discovery.etcd.io/new
https://discovery.etcd.io/6a28e078895c5ec737174db2419bb2f3

Next, edit the cloud-config file (see above), in order to add this configuration:

coreos:
    etcd:
        discovery: https://discovery.etcd.io/<token>
        addr: ADDR_RPN:4001
        peer-addr: ADDR_RPN:7001
    units:
        - name: etcd.service
          command: start
        - name: fleet.service
          command: start

Replace the discovery URL with the one you obtained befor and ADDR_RPN with the RPN address of your server.

Reboot to take changes into account, the cluster will automatically be formed at the start of your machines, you can dynamically add or remove the machines in your cluster by simply editing the cloud-config file and restarting.

To verify that your cluster is formed, the following command will list the machines:

$ fleetctl list-machines

For more information: CoreOS Cluster Discovery, CoreOS Cluster Architectures, Getting Started with etcd

Fleet

Fleet is a distributed init system that allows you to configure the start of services within a server cluster.

Based on * systemd, it can deploy services within a cluster according to several levels of availability.

Linked to docker, the possibilities are numerous and the official documentation covers a large number of possible uses. For more information: Launching Containers with fleet, Getting Started with systemd

Rescue mode

When your server is rescue mode, you can access the root partition of the system by mounting the volume /dev/sda9, you can edit the cloud-config file in the rescue mode, the changes will be taken into account when starting CoreOS.