Skip to content

Commit ee5f8a3

Browse files
committed
feat(contrib/digitalocean): Use native CoreOS integration
Use the native CoreOS experience as recently added by DigitalOcean. This rewrites the previous provisioning script and replaced the tugboat dependency by the new docl tool dependency. Docl was written specifically to support the operations we need. Once a new DigitalOcean CLI comes out with support for the metadata flag the use of Docl can be reexamined.
1 parent f95204b commit ee5f8a3

9 files changed

Lines changed: 48 additions & 356 deletions

contrib/digitalocean/README.md

Lines changed: 25 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
11
# Provision a Deis Cluster on DigitalOcean
22

3-
## Note on Deis support for DigitalOcean
4-
DigitalOcean support was contributed by [sttts](https://github.com/sttts). The CoreOS bootstrapping
5-
is heavily based on [Levi Aul's code](https://gist.github.com/tsutsu/490f35f48897df0f5173).
6-
7-
Note that DigitalOcean does not support CoreOS images natively. To work around this, the provision
8-
scripts for DigitalOcean first create a CoreOS image which will be used for provisioning the cluster.
9-
10-
Until native DigitalOcean support for CoreOS is implemented, this workaround is likely to be more fragile than deploying
11-
Deis to other cloud platforms which support CoreOS natively.
12-
13-
UPDATE: As of July 15, 2014, native CoreOS support on DigitalOcean is [planned](http://digitalocean.uservoice.com/forums/136585-digital-ocean/suggestions/4250154-suport-coreos-as-a-deployment-platform).
14-
153
## Customize cloud-config.yml
164
Edit [user-data](../coreos/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.
175

18-
## Install tugboat and authorize:
19-
The tugboat gem consumes the DigitalOcean API.
6+
## Install docl and authorize:
7+
The docl gem consumes the DigitalOcean API.
208
```console
21-
$ gem install tugboat
22-
$ tugboat authorize
9+
$ gem install docl
2310
```
24-
You can leave all but the client and API keys as the defaults.
2511

26-
## Upload keys
27-
Choose an SSH keypair to use for Deis and import it to DigitalOcean:
12+
Before you can authorize you need to [create a Personal Access Token](https://www.digitalocean.com/community/tutorials/how-to-use-the-digitalocean-api-v2). Make sure you create a read & write token.
13+
Copy paste the token (make sure you also save it somewhere encrypted) before you continue to the next step.
14+
2815
```console
29-
$ tugboat add-key deis
16+
$ docl authorize
3017
```
3118

32-
Then, get the ID of the key:
19+
## Upload keys
20+
Choose an SSH keypair to use for Deis and import it to DigitalOcean:
3321
```console
34-
$ tugboat keys
22+
$ docl upload_key deis ~/.ssh/deis.pub
3523
```
24+
This will print the ID of the uploaded key. Copy and paste the ID, you will need it in a later step.
3625

37-
## Create a Deis image:
26+
In case you forget the ID of the public key you can retrieve it later with the following command:
3827
```console
39-
$ ./provision-digitalocean-deis-image.sh <SSH KEY ID> [REGION_ID]
28+
$ docl keys
4029
```
4130

4231
## Choose number of instances
@@ -53,44 +42,35 @@ Deis clusters of less than 3 nodes are unsupported.
5342
## Deploy cluster
5443
Run the provision script:
5544
```console
56-
$ ./provision-do-cluster.sh <REGION_ID> <IMAGE_ID> <SSH_ID> <SIZE>
45+
$ ./provision-do-cluster.sh <REGION_ID> <SSH_ID> <SIZE>
5746
```
5847

59-
Not all regions allow private networks. Choose one which does (at the time of this writing, NY 2,
60-
Amsterdam 2, Singapore 1 or London 1) - check the web UI for the current private network support.
48+
Not all regions allow private networks. Choose one which does (at the time of this writing, NY 2 & 3,
49+
Amsterdam 2 & 3, Singapore 1 or London 1) - check the web UI for the current private network support.
6150

62-
You can enumerate all the regions with:
51+
You can enumerate all of the supported regions with:
6352

6453
```console
65-
$ tugboat regions
54+
$ docl regions --private_networking --metadata
6655
```
6756

68-
The provisioning script uses a 512 MB droplet by default because for image creation
69-
more memory is not needed. Deis controller nodes will need at least 2 GB to even start all
57+
Deis controller nodes will need at least 2 GB to even start all
7058
the services. Add the memory requirements of deployed applications and choose an adequate
71-
droplet size. The default is 8 GB (ID "65"). You can enumerate all sizes with:
59+
droplet size. The default is 8 GB. Specify the size with NGB, where N is 2, 4, 8, 16, 32 or 64.
7260

73-
```console
74-
$ tugboat sizes
75-
```
76-
77-
## Choose number of routers
78-
By default, the Makefile will provision 1 router. You can override this by setting `DEIS_NUM_ROUTERS`:
79-
```console
80-
$ export DEIS_NUM_ROUTERS=2
81-
```
61+
This will print the IP addresses of the initialized machines.
8262

8363
## Initialize the cluster
84-
Once the cluster is up, get the IPs of any of the machines using `tugboat droplets`, set
85-
DEISCTL_TUNNEL to one of these IPs:
64+
set DEISCTL_TUNNEL to one of the IPs of the virtual machines (these are printed on the console in a previous step). You can also login to the web interface of DigitalOcean to see the Public IP addresses.
65+
8666
```console
8767
$ export DEISCTL_TUNNEL=23.253.219.94
8868
$ deisctl install platform && deisctl start platform
8969
```
90-
The script will deploy Deis and make sure the services start properly.
70+
Deisctl will deploy Deis and make sure the services are started properly. Grab a coffee.
9171

9272
### Configure DNS
93-
You'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/operations/configure-dns/) for details.
73+
You'll need to configure DNS records so you can access applications hosted on Deis. See [Configuring DNS](http://docs.deis.io/en/latest/installing_deis/configure-dns/) for details.
9474

9575
### Use Deis!
9676
After that, register with Deis!

contrib/digitalocean/cloud-config.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

contrib/digitalocean/coreos-apply-user-data

Lines changed: 0 additions & 2 deletions
This file was deleted.

contrib/digitalocean/coreos-setup-environment

Lines changed: 0 additions & 21 deletions
This file was deleted.

contrib/digitalocean/create-coreos-docker-store

Lines changed: 0 additions & 13 deletions
This file was deleted.

contrib/digitalocean/provision-digitalocean-deis-image.sh

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)