Architecture of container environment

Hi all

I’ve been thinking about a new setup, on different servers. But I’m having trouble with the architecture.

Is it best to set up a container per service (separate web, db) and then host different applications on spread over them?

Or rather a container per application (purpose).

About clustering, I guess that if the cluster is on the same physical machine, the sole purpose is for easy updating and restarting with HA? So for failover, you should likely make the cluster with a container on a separate host?

And what about scalability. Can you add a container for extra resources to an application and then load balance between them?

Thanks for your answers.


I do not know much about clustering, but it’s a container, what you probably need is an Orchestrator and that’s where I don’t know much more.
In LXD you can pretty much put what you want, only issue is where your persistent files go, those have to be ironclad safe!
Just keep it simple for the start and take it has you go I guess.

For the orchestrator side, things are even more blurry for me at the moment. I’m starting ansible for other deployments and config mgmt, but the combination with LXD doesn’t seem soon for me.

Storage-wise I’ll probably opt for a glusterfs cluster, and I’m guessing databases are safe enough in a non-privileged container. Though I had someone in the docker IRC advising me not to put DB-clusters in containers. Not sure why though.

For Db’s not in docker it’s because docker is more for stateless services, docker has that thing if it goes wrong destroy it and make another one… statefull services like DB maybe safer with an external storage.
Docker also everything runs on Root, dont know why and it makes no sense.
Docker also has an issue that if you want to run several services inside a container, you need something called supervisorD… and it sucks, it just adds a more complexity to something that is suppose to be simple

Gluster has an issue if you are running it on a Mechanical HDD and many small files, performance just drops to unsuable, it is a lot better with SSD’s, if you are using HDD then DRBD is a better choice, Ceph is stable…ish I guess.

Kubernates is an orchestrator and Docker Swarm also, for LXD you have OpenStack.

if you have more then one service per container use LXD/LXC, you can use cgroups and you are safer
if you want to use multiple dockers in one machine try and put it on a user on stick it inside a LXD/LXC.

ask around read a lot, and dont go full DevOps it wont work because the learning curve is huge, take baby steps.
Also what I said could also be very wrong, always be critique and curious! :smiley:

1 Like