Docker Compose: Deploying various services from docker-compose.yml to different host sets

Say I have a file docker-compose.ymlwith three different services (s1, s2, s3). Then, if I divorce them, say, AWS ECS (for example only) from a single host cluster, all three containerswill go to that host. If I scale the hosts of cluster 2, then the second host, then the second host will also receive all three containers.

Ideally, I would like to have different clustersfor different services, so that they can be scaled independently. I would not want to have a database container in the same cluster as my container backend, since both of them have different scaling requirements.

How can I achieve this behavior with docker?

Kubernetes has a concept podsthat provides this abstraction, however, since it is not part of the docker, I want to know how to develop a multi-service application in docker, in which each service(as defined in docker-compose.yml) can be scaled independently. *

+4
source share
2 answers

For ECS, you need to either create multiple clusters (i.e. a cluster for each part of the infrastructure, if you stick to deployment through compose), or just create multiple tasks. Each task should be a layer in your stack (e.g. api or web, etc.). Then you can scale the layers yourself.

, ECS K8S, , , ECS , , .

: http://docs.aws.amazon.com/AmazonECS/latest/developerguide/application_architecture.html

0

:

docker-compose docker containers .

docker-swarm - containers .

A cluster, , ( ), , .

A Pod : , , , node, localhost.

Kubernetes nodes , node , , : Kubernetes .

:

  • , ( )
  • , ( ), .
0

Source: https://habr.com/ru/post/1648017/


All Articles