Microservices in the cloud with Tutum

Deploying several microservices into the cloud with Tutum.

This is one of 3 blog posts

I have a website plus a microservice up and running locally, both using fuge and inside docker containers via docker-compose. Time to deploy the containers to the cloud.

I will try Tutum to do this. I have opened a Tutum account, and have linked both my GitHub and DigitalOcean accounts.

Building and deploying a single image

I tried deploying one of the public Docker Redis images - it went without a hitch, even spinning a DigitalOcean node when needed. After testing it using as-a, I wanted to deploy multiple images.

Deploying several containers

In order to build multiple private Docker images, I created a private Docker registry on Tutum and a private repository. A developer gets a single private repository for free.

Just a note - the same single prebuilt Redis image (not Docker container) is available from DigitalOcean too, which makes this comparison less impressive.

repository

The repository wraps around GitHub repo bahmutov/demo-microservices and will produce two Docker images: "site" and "addition".

repo images

I just listed the path to each Dockerfile inside this repository, and kicked off the builds. I had to retry building the "site" Docker image several times - seems the npm install step had flaky NPM registry access. This is something I did not have to worry with other services in a while.

To deploy several microservices at once, I created a stack file, which is very similar to docker compose file. Here is the initial stack file listing the site service and the addition service.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
site:
image: bahmutov/demo-microservices:site
links:
- addition
ports:
- "80:80"
roles:
- global
environment:
- SERVICE_HOST=0.0.0.0
- SERVICE_PORT=20000
- addition_PORT=10001
addition:
image: bahmutov/demo-microservices:addition
environment:
- SERVICE_HOST=0.0.0.0
- SERVICE_PORT=20001
- addition_PORT=10001
ports:
- "10001:20001"

You can find the latest file in the repo under tutum.yml.

When deploying this stack, I got 1 node working right away - the "addition" container. The "site" container could not be started, and after poking around I found that I needed to allocate more than 1 node. Ok, so I tried, but then Tutum prompted me to pay for the Node cluster at $0.02 per node per hour. Wait a minute! I am paying for DigitalOcean to actually host my code, and Tutum wants me to pay per node hour to deploy?!

So that was the end of Tutum. Several UI glitches, not using docker-compose.yml file, flaky NPM registry connection, trying to get me to pay per hour - I was disappointed.

And the last thing that annoyed me with Tutum - there was no simple way to delete my account! I have unlinked all services, yet there was no clear "Delete" button or link anywhere.