Skip to content

Latest commit

 

History

History
106 lines (84 loc) · 3.47 KB

README.md

File metadata and controls

106 lines (84 loc) · 3.47 KB

Provision a Deis Cluster on Digital Ocean

Note that Digital Ocean does not support CoreOS images natively. To work around this, the provision scripts for Digital Ocean first create a CoreOS image which will be used for provisioning the cluster.

Digital Ocean support was contributed by sttts. The CoreOS bootstrapping is heavily based on Levi Aul's code.

To deploy Deis to Digital Ocean:

Customize cloud-config.yml

Edit user-data and add a discovery URL. This URL will be used by all nodes in this Deis cluster. You can get a new discovery URL by sending a request to http://discovery.etcd.io/new.

Install tugboat and authorize:

The tugboat gem consumes the Digital Ocean API.

$ gem install tugboat
$ tugboat authorize

You can leave all but the client and API keys as the defaults.

Upload keys

Choose an SSH keypair to use for Deis and import it to Digital Ocean:

$ tugboat add-key deis

Then, get the ID of the key:

$ tugboat keys

Create a Deis image:

$ ./provision-digitalocean-deis-image.sh <SSH KEY ID>

Choose number of instances

By default, the script will provision 3 servers. You can override this by setting DEIS_NUM_INSTANCES:

$ export DEIS_NUM_INSTANCES=5

Note that for scheduling to work properly, clusters must consist of at least 3 nodes and always have an odd number of members. For more information, see optimal etcd cluster size.

Deis clusters of less than 3 nodes are unsupported.

Deploy cluster

Run the provision script:

$ ./provision-do-cluster.sh <REGION_ID> <IMAGE_ID> <SSH_ID> <SIZE>

Not all regions allow private networks. Choose one which does, e.g. NY 2, Amsterdam 2 or Singapore 1 at the time of this writing (check the web UI for the current private network support). You can enumerate all the regions with:

$ tugboat regions

The provisioning script uses a 512 MB droplet by default because for image creation more memory is not needed. Deis controller nodes will need at least 2 GB to even start all the services. Add the memory requirements of deployed applications and choose an adequate droplet size. The default is 8 GB (ID "65"). You can enumerate all sizes with:

$ tugboat sizes

Choose number of routers

By default, the Makefile will provision 1 router. You can override this by setting DEIS_NUM_ROUTERS:

$ export DEIS_NUM_ROUTERS=2

Initialize the cluster

Once the cluster is up, get the IPs of any of the machines using tugboat droplets, set FLEETCTL_TUNNEL to one of these IPs:

$ export FLEETCTL_TUNNEL=23.253.219.94
$ cd ../.. && make run

The script will deploy Deis and make sure the services start properly.

Configure DNS

You'll need to configure DNS records so you can access applications hosted on Deis. See Configuring DNS for details.

Use Deis!

After that, register with Deis!

$ deis register http://deis.example.org
username: deis
password:
password (confirm):
email: [email protected]

Hack on Deis

If you'd like to use this deployment to build Deis, you'll need to set DEIS_HOSTS to an array of your cluster hosts:

$ DEIS_HOSTS="1.2.3.4 2.3.4.5 3.4.5.6" make build

This variable is used in the make build command.