Which architecture should I use to preinitialize N dockers in one server?

3/20/2019

I want to create in just one server an application that runs inside a docker. I want the server to always have N active dockers running and if an N+1 user enters, then a new docker is launched.

I think that I need this architecture:

Nginx for load balancing Kubernetes, to orchestrate the dockers Docker, with the app inside this docker.

Is this correct? I am not sure if Kubernetes is what I need when I´m only going to use just one server.

-- jff
docker
kubernetes
nginx

1 Answer

5/30/2019

You probably want to use the cluster autoscaler functionality of kubernetes. Docs here: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/

Your approach of using users number as a metric will probably work, but maybe you are better off using generic metrics, such as the CPU consumption or memory availability on your node. For that you define the maximal consumption that your containers are allowed to use.

-- Antonio Matarrese
Source: StackOverflow