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 :
- Have a AWS Auto scaling group.
- Instance has Docker and Docker compose installed .
- Docker images are pulled from Artifactory.
- docker compose file is also downloaded .
- Below is the content of the yml file.
version: “3”
services:
web:
# replace username/repo:tag with your name and image details
image: client:latest
entrypoint: “/app/startserver.sh ${hostname}”
deploy:
restart_policy:
condition: on-failure
replicas: 2
mode: replicated
ports:
- “8999:8999”
networks:
- webnet
service:
# replace username/repo:tag with your name and image details
image: service:latest
ports:
- “38080:8080”
networks:
webnet:
- 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 .
thanks,
BK