Docker Community Forums

Share and learn in the Docker community.

What to use ? Docker-swarm or Kubernetes


(bk) #1

Hello ,

I am trying to architect an application which is highly available. I have started exploring about Docker and lately able to achive till implementaiton of Docker compose .

So My existing approach is this :

  1. Have a AWS Auto scaling group.
  2. Instance has Docker and Docker compose installed .
  3. Docker images are pulled from Artifactory.
  4. docker compose file is also downloaded .
  5. Below is the content of the yml file.

version: "3"
# replace username/repo:tag with your name and image details
image: client:latest
entrypoint: "/app/ ${hostname}"
condition: on-failure
replicas: 2
mode: replicated
- "8999:8999"
- webnet
# replace username/repo:tag with your name and image details
image: service:latest
- "38080:8080"

  1. Now whenever there is high traffic the cpu util spikes up and the Auto scaling group will create new ec2 and I wil be following all the steps above again in the new ec2 .

Now I understand that Docker-swarm and Kuberenetes will create clusters and work in a more optimized way . But I am unclear how I can ustilize Autoscaling group and Docker-swarm/kuberentes together .
How can the new nodes be added to the cluster automatically when its spinned up by the aws autoscaling group .

Aprreciate anyones help for a better solution .


(bk) #2

Hello @sdetweil . will be glad to hear from you if you have any sugestions . thank you :slight_smile:

(Sam) #3

i cannot answer on a hybrid aws deployment… I use aws ECS, and let it create the new ec2 instance (ecs instance), and load the new web server instance container(s) (ecs task) that are load balanced. the app is php, executed from the amazon efs volumes.

there is also a docker for AWS that will do the whole thing… I think it uses swarm.

(bk) #4

Wow , thats an easy answer :slight_smile: . But currently ECS is not followed in my org so thinking about something else . thanks for your response.

(John Rofrano) #5

If you have already decided that AWS is your cloud, you should seriously look into their new Kubernetes offering (not ECS but EKS). You can also deploy your own Kubernetes cluster and use auto scaling groups for the Kubernetes nodes just as you want.

A quick Google search revealed this guide: