Running DC/OS on Packet

OPEN SOURCE

Install DC/OS cluster on Packet bare metal using Terraform

DISCLAIMER: This is a community driven project and not officially supported by Mesosphere. This installation method is used for fast demos and proofs of concept. This page explains how to install DC/OS cluster on Packet bare metal using Terraform templates. Terraform is intended for reference only and are not recommended for production use. Upgrades are not supported with the following installation methods.

NOTE: Contact the mailing list or Slack channel for community support.

You can create a DC/OS cluster on Packet bare metal using Terraform. The included Terraform templates are configured to run Mesosphere DC/OS on Packet. Depending on the DC/OS services that you install, or the amount of computing power your workload needs, you might have to modify the templates to suit your needs. You can modify the Terraform templates, but Mesosphere cannot assist in troubleshooting. If you require support, you can email help@packet.net, visit the Packet IRC channel (#packethost on freenode) or consider DC/OS Enterprise.

Hardware

  • One, three or five Mesos master nodes in the admin zone

  • Four Mesos private agent nodes

  • One Mesos public agent node

  • Packet “Type 0” Server instances

Create a DC/OS cluster

Prerequisites

Installing DC/OS

IMPORTANT: With this method, the network is open by default. Because of this, network security is a concern and should be addressed as soon as possible by the administrator.

  1. Download and install Terraform using the instructions on the link provided in the Prerequisites section.

  2. Download the DC/OS Terraform manifests from GitHub into a local directory.

    1. git clone https://github.com/dcos/packet-terraform
  3. From that directory, generate an ssh keypair:

    1. ssh-keygen -t rsa -f ./packet-key
  4. Copy sample.terraform.tfvars to a new file named terraform.tfvars, and edit the new file, filling in the values as desired. The following are blank and if not filled in, you will be prompted by terraform when necessary:

    • packet_api_key - Your Packet API key

    • packet_project_id - Packet Project ID

    • dcos_installer_url - Where to get DC/OS configuration file

  1. The following have default values and may be changed depending on your requirements:
  2. - `packet_facility` - Packet facility: \[ewr1|sjc1|ams1\] ewr1 is New Jersey, ams1 is Amsterdam, sjc1 is San Jose - default sjc1
  3. - `packet_agent_type` - Type of Packet Server to use for the DC/OS Agents: \[`baremetal_0`|baremetal\_1|baremetal\_3\] Choose the Packet Server type to use for the DC/OS Private Agents - default `baremetal_0`
  4. - `packet_master_type` - Type of Packet Server to use for the DC/OS Master: \[`baremetal_0`|baremetal\_1|baremetal\_3\] Choose the Packet Server type to use for the DC/OS Master Nodes - default `baremetal_0`
  5. - `packet_boot_type` - Type of Packet Server to use for the DC/OS Boot Node: \[`baremetal_0`|baremetal\_1|baremetal\_3\] Choose the Packet Server type to use for the DC/OS Boot Server - default `baremetal_0`
  6. - `dcos_cluster_name` - the name of your DC/OS cluster - defaults to `packet-dcos`
  7. - `dcos_agent_count` - Number of private agents to deploy - defaults to four
  8. - `dcos_public_agent_count` - Number of public agents to deploy - defaults to one
  9. - `dcos_init_pubkey` - The path to your ssh public key created in step 4 - defaults to ./packet-key.pub
  10. - `key_file_path` - The path to your ssh private key created in step 4 - defaults to ./packet-key
  1. Also from that same directory, run terraform apply which will deploy the servers into your project at Packet, and run the DC/OS installation routine. When it completes, you will see output similar to the following, but with the IP addresses assigned to your servers:

    terraform apply output

    Figure 1. “Terraform apply” output

You may need to wait a few minutes from this point for all the DC/OS services to become active and the control panel available on the master node. After 15 or 20 minutes, see the troubleshooting documentation.

Launch DC/OS

Launch the DC/OS web interface by entering the Mesos master IP address:

  1. Cut and paste the link provided by running terraform apply, or by running terraform output from the same directory, into your browser to open the DC/OS web interface. The interface runs on the standard HTTP port 80, so you do not need to specify a port number after the hostname.

  2. Install the DC/OS Command-Line Interface (CLI). You can install the CLI to administer your DC/OS cluster. You can access the documentation at any time by clicking the cluster name in the upper-left side.

    install CLI

    Figure 2. Install DC/OS CLI screen

Next steps

  • Adding and removing nodes:

    • Run terraform apply -var ‘dcos_agent_count=N’ to change the private agent count to the number specified. (‘dcos_public_agent_count’ is also available).

    • Increasing node count is fast and safe.

    • We recommend against reducing the node count in production. Stateful DC/OS apps and services may suffer outages and failures if nodes are not put into maintenance mode, and their tasks rescheduled through their respective schedulers.