codesuki / ecs-nginx-proxy

Reverse proxy for AWS ECS. Lets you address your docker containers by sub domain.
MIT License
98 stars 23 forks source link

Fargate Support #20

Open backtrackbaba opened 6 years ago

backtrackbaba commented 6 years ago

Would this ECS nginx proxy work with Fargate too? I am trying to implement it on Fargate but I'm running into problems getting it started

codesuki commented 6 years ago

Any error messages? I haven't used Fargate, but it says it's based on ECS. Will check the docs when I find some time.

davidworkman9 commented 6 years ago

Hi @codesuki, I'm trying to get this running with fargate as well. Everything is running, but the nginx proxy container logs InvalidParameterException: Container instance cannot be empty.. I've attached a role to my task with the permission: AmazonEC2ContainerServiceFullAccess

davidworkman9 commented 6 years ago

@Digging into this, it appears that ecs.listContainerInstances returns an empty array when the cluster is backed by fargate instead of EC2.

EDIT: Tried running this in a cluster with a mix of fargate and EC2 services, still doesn't work but I get a different error message: container has no network bindings. skipping. It does correctly list containers running in EC2 mode in the output file.

More information - The above error message is because fargate seems to have a networkInterface instead of a networkBindings. Looks like the only need to extract that information is to get the port it's running on, I hardcoded port 80 and now I'm running into the fact that there isn't a ContainerInstanceArn on the task.