How to autoscale Docker container hosts?

11/5/2015

I'm developing a Docker-based web service, where each subscriber has private access to their own Docker container running in the cloud, exposing port 443.

I've used nginx-proxy/docker-gen successfully to serve multiple Docker containers from the same VM, with just port 443 exposed to the public net.

This works fine ... but what do I do when the subscribers saturate the VM resources? (As a simple example, I may have a practical limit of 10 subscribers' containers on a single DigitalOcean 2Gb instance serving as a Docker host.)

Eg when subscriber #11 signs up, I need to have a new Docker host ready and waiting to start up that new container.

In other words, I want to do horizontal autoscaling of my Docker hosts, responsive to user subscription demand. Doing some service discovery and making the containers publicly-addressable would be nice.

I'm trying to work out what the best solution is. Kubernetes 1.1 seems to support auto-scaling of Pods (ie basically increasing the number of containers...) but not the auto-scaling of the container hosts ("minions" in Kubernetes-speak??)

I've looked at the following projects which seem close to what I need:

  • Deis - no explicit autoscaling as far as I can tell
  • Tsuru - possible autoscaling solution but limited to count/RAM
  • Mesos/Mesosphere - probably much more complex than necessary

Can anybody make any useful suggestions??

-- danzvash
autoscaling
docker
kubernetes

1 Answer

11/12/2015

As of Kubernetes v1.1, you can now implement a Horizontal Pod Autoscaler: http://kubernetes.io/v1.1/docs/user-guide/horizontal-pod-autoscaler.html

-- James Brown
Source: StackOverflow