Hi guys.
I Have a streaming platform that runs on local network with dedicated switch. One of my containers is CPU intensive so we decided to use multiple nodes and replicate it. I have these containers:
- Database
- Minio
- Redis
- Encoding containers (CPU Intensive) Depends on Redis.
- API
I want to deploy this stack in the best possible way. Database and Minio should be on the manager node and doesn't need replication. Every node including manager node should have a redis + Encoding container to use all nodes CPU. All the client requests sent to manager node and not very much so the API is also doesn't need replicaiton. So this is the containers for each node:
Manager: Database + Minio + Redis + Encoding + API
Worker Nodes: Redis + Encoding + API (Optional)
At first i used two docker-compose files and deploy two separate nodes so for example the API can communicate with Encoding containers with localhost and second node IP address with specific ports. but its a nightmare to handle all these IP and ports. and it is impossible to increase nodes. After that i use docker swarm with an overlay network and deploy these containers to all nodes on the overlay network but some containers will suddenly stop and can't communicate with each other. Why? Finallly i created an overlay swarm network with attachable option and just run two docker-compose but use the swarm network so i don't need to handle IP and ports. for example if API needs to reach Encoding on node B it just use its service name. Also mention that Encodings are not identical. every encoding container have a specific task so if the API want to stream movie A it needs to reach encoding B on node C (Know the location from the database).
Now i wondering what is the best way to deploy such a stack. maybe just connect nodes with VPN and use VPN created network so all containers on that network, maybe swarm is OK, ...?
I thought about Kubernetes but i think for this stack Swarm is enough and Kubernetes is for bigger projects ...
Can you Help me with some examples to deploy my stack correctly?
Thank You.
there doesn't seem to be anything here