- Create an AWS account
- Sign up for AWS ECS
- Create a private docker image repository on ECS
- Build and push your docker image to your ECS image repository
- Create a task definition using your docker image
- Create a cluster
- Create an EC2 instance using an ECS-optimized image and register it with your cluster
- Create an elastic load balancer (ELB)
- Create a container service in your cluster and configure it to use your ELB
By the end, you will be able to visit the public DNS of your ELB which will forward requests to one of the containers you have running inside an EC2 instance. Most of the work lies in the configuration and a lot of that is not fun. I'm trying to reduce the job of deploying containers down to:
- Build and push your docker image to your ECS image repository
Everything else will be done automatically based on default configuration. I should be able to just visit a URL and see my running application. Adding more layers of the stack to it will take more work, but just running containers using a single image should be as easy as that.
Some questions I still have are:
- What's the easiest way to deploy new images for an application to ECS? Ideally I just have to hit push and then the existing containers are replaced by new containers running my new image.
- How do IAM roles and security groups work?
- How do I know requests are actually being distributed evenly by the ELB?
- How should I stop my running containers? Do I stop it via the service level or the container level?
- What happens to my containers if I shut down my EC2 instances?
- Where are my logs located? If my app crashes, where do I look?
- How do I connect my app running in a container to another app running in a different container? Say, a database server for instance.
No comments:
Post a Comment