Getting Started

For the most part, Docker containers are less fit for production than standard machines (VM, LXCs) because of the mystical nature of volumes and their management. With that said, they are useful for development, testing, and quick roll-out of very complicated services.

DNS records for your control panel should be set up before embarking on installation, or SSL certificate verification will not work and the security of your installation may be compromised. Two hosts should be configured:

  • panel.example.com
  • t1.example.com

dnsmasq may be used to provide authoritative DNS with just 2 or 3 configuration lines:

address=/panel.example.com/172.17.0.2
address=/t1.example.com/172.17.0.3

When using the --dns= switch to docker run, your containers will benefit from this configuration as well.

For all components, starting with a blank MySQL root password is simplest, as the bootstrap scripts will take care of configuring that for you.

To integrate into an existing infrastructure, use /root/mysql.info to provide SQL credentials to the installer in the format:

ROOTPASSWORD=root.password.here.123
USERPASSWORD=clusterducks.dbuser.password

Installing the Panel

Docker

  1. Download latest git source
  2. Build the Docker container:

    root@docker-host /usr/share/clusterducks $ docker build -t clusterducks .

  3. Run the panel container, replacing panel1.example.com with your real DNS record that will point to the panel web server (or HA proxy frontend):

    root@docker-host /usr/share/clusterducks $ docker run --name=panel --hostname=panel.example.com clusterducks

Install from source

  1. Configure a basic Ubuntu 14.04 (or higher) VM or LXC - it should be a instance dedicated to the control panel role
  2. Download latest git source to /usr/share/clusterducks or any location that suits your needs
  3. Configure your webserver as desired - apache2 is required for API URI rewriting until someone submits patches to support other httpd
  4. Browse to the panel path
  5. Install any missing dependencies and correct any permissions errors
  6. Create a cronjob that runs panel/cronjob.php as your webserver user every minute with no arguments
  7. Login using installer-provided credentials

Tunnel service

The tunnel service is required to broker API requests from the panel to remote storage + compute servers. It is a set of wrappers around OpenSSH to provide secure TCP port forwarding using DB-backed SSH key authentication.

Docker

Docker requires use of extra arguments when running the tunnel service container.

  1. Download the latest tunnel-agent source
  2. Build the Docker container:

    root@docker-host /usr/src/tunnel-agent $ build -t tunnel-agent .

  3. Run the tunnel service, replacing the bold values with your own. If using a local DNS service for testing, use that instead of 8.8.8.8:

    root@docker-host /usr/src/tunnel-agent $ docker run --dns=8.8.8.8 -e PANEL_HOSTNAME=panel.example.com --hostname=t1.example.com -e SERVER_KEY=example.key1 --name=tunnel-service --cap-add net_admin tunnel-agent

Install from source

  1. Configure a basic Ubuntu 14.04 (or higher) VM or LXC - it should be a instance dedicated to the tunnel service role
  2. Download the latest tunnel-agent source to /usr/share/tunnel-agent and cd to the install directory.
  3. Run the install script:

    root@tunnelservice /usr/share/tunnel-agent/install $ chmod +x ./install.sh && ./install.sh -k example.key1 -h panel.example.com

Configuring a Server

Storage nodes may not be completely containerized due to integration with low-level storage components. A script-based install is the only method.

As of v0.9.2, only /var/www is the supported install prefix for the storage + compute server agent.

  1. Install Debian or Ubuntu, leaving plenty of storage space for a ZFS pool to be created later - the more storage that's available, the more room for expansion your network will have.
  2. Download the latest client source code from Gogs to /var/www and cd to the install directory
  3. Run the installer - replace examplekey.2 with the key created when adding the server in the control panel:

    root@storage /var/www $ chmod +x install.sh && ./install.sh -h panel.example.com -k examplekey.2

  4. Manually create a ZFS pool with the name used in the control panel - this is important.
  5. Re-run the installer and it will create any necessary ZFS filesystems

If you do have any issues, please find us on IRC, #clusterducks@Freenode.