DigitalOcean
Because DigitalOcean doesn't offer any automation process to distribute images, you'll need to use the Packer tool to generate an image for your account. Once you've generated an image, you can reuse it as many times as needed.
Heads Up!
You will need a domain name, and access to your DNS settings to properly set up a secured instance.
Download
You'll need to download the Coronium repo to compile your snapshot.
After you have your download, unpack the archive, and navigate to the deploy/digitalocean
folder. The README document contains the most current deployment instructions.
Preflight
To compile instances to your DigialOcean account, you must generate an API token. You can remove this token after your compilation is complete, or save it for later.
Requirements
packer
Download and install Packer to generate images.
Configuration
do.json
In the digitalocean/packer
directory, open and edit the file do.json
by entering your service details:
nano do.json
do.json
{ "do_size": "512mb", "do_region": "nyc3", "do_hostname": "your.coronium.instance", "do_token": "< your-digital-ocean-api-token >", "ssl_enabled": false, "ssl_email": "< contact@localhost.domain >" }
Don't commit the do.json
file to version control!
Properties
Key | Value | Default |
---|---|---|
do_host_name |
Your host domain name (FQDN). | null |
do_size |
The size of the cloud droplet. | 512mb (see sizes) |
do_region |
The region code this image will reside in. | nyc3 (see regions) |
do_token |
A generated DigitalOcean API token. | null |
ssl_enabled |
Prepare this instance for SSL certs. | false |
ssl_email |
Email to use for the SSL certificate. Must be valid. | null |
Sizes
Memory amounts can be assigned with mb
or gb
suffixes.
Common Sizes Include: 512mb, 1gb, 2gb, 4gb, 8gb, 16gb, 32gb
Regions
The following regions support IPV6, and memory options between at least 512mb-32gb. See the DigitalOcean site for more sizes and CPU options.
Region Name | Region Code |
---|---|
Amsterdam 2 | ams2 |
Amsterdam 3 | ams3 |
Bangalore 1 | blr1 |
Frankfurt 1 | fra1 |
London 1 | lon1 |
New York 1 | nyc1 |
New York 2 | nyc2 |
New York 3 | nyc3 |
San Francisco 1 | sfo1 |
San Francisco 2 | sfo2 |
Singapore 1 | sgp1 |
Toronto 1 | tor1 |
Generate Snapshot
To create the Droplet Image...
Navigate to the digitalocean/packer
folder using a terminal program.
Enter and run the following:
packer validate -var-file=do.json cloud.json
If the .json
files "validate" then continue, if not, fix em up.
Once "valid", run the following:
packer build -var-file=do.json cloud.json
The image should become available within 10-15 minutes in the snapshots area.
Note: During the compilation process, a temporary build droplet is brought up. Once the image has been rendered, this droplet is removed. Do not remove or stop the build droplet during compilation.
You will receive a message in the terminal window when the build has finished.
One Moment...
If you try to deploy, and your region is "unavailable", the snapshot may still be transferring. Try again in a few minutes.
Secure An Instance
To continue, the following are required:
- Running Coronium System
- An active domain name
- DNS pointing to your instance
- An active email address (any)
SSL Module
You will need to download and install the Coronium SSL module on the system:
Start by logging into your system via the terminal, using the domain name:
ssh cloud@your.cloud.domain
Password: cloudadmin
Run the following in your terminal:
# Go Home cd ~ # Download wget -O Coronium-LS-SSL.zip https://gitlab.com/coroniumcloud/Coronium-LS-SSL/repository/archive.zip?ref=master # Unzip master.zip unzip Coronium-LS-SSL.zip # Move into the module dir cd Coronium-LS-SSL-master-*
And then...
Module Config
You will need to provide your instance domain name and a valid email to generate the certificates.
Heads Up!
Make sure these values are correct (triple-check). If not then there will be problems issuing the SSL certificates. Using a subdomain is highly recommended.
Open the ssl.json
file:
nano ssl.json
ssl.json
{ "ssl": { "hostname": "your.cloud.domain", "email": "contact@your.email", "staging": false } }
Key | Description | Example |
---|---|---|
hostname |
The domain name (subdomain included) for the cloud instance. | "cloud.domain.io" |
email |
A valid email address for certificate related information. | "you@email.com" |
staging |
Flag for production-ready certificates. | true |
Replace the hostname
and email
keys to match your information.
Set the staging
flag to false
if you are requesting production-ready certificates.
Save the file (ctrl-x
, y
, enter
).
Install Certificates
In the Coronium-LS-SSL-master-*
directory, run:
# Stop processes, if any. sudo cloud down # Install and configure the SSL module sudo chef-client -c config.rb -j ssl.json -r secure # Once done (2-5 mins) sudo cloud up
Clean Up
cd .. sudo rm Coronium-LS-SSL-master-*.zip sudo rm -rf Coronium-LS-SSL-master-*
Check HTTPS
https://your.cloud.domain/echo/test?ssl=active