Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem running reproxy in AWS ECS on Fargate #92

Open
avowkind opened this issue Jun 17, 2021 · 4 comments
Open

problem running reproxy in AWS ECS on Fargate #92

avowkind opened this issue Jun 17, 2021 · 4 comments

Comments

@avowkind
Copy link

reproxy maps var/run/docker.sock into its container using a volume so that it can query the settings of the other containers.
I can use docker context ecs and docker compose to bring up a docker composer file as a cluster on AWS ECS on Fargate.
I get the following error in the reproxy log
2021/06/17 13:55:42.903 [ERROR] failed to fetch running containers: can't list containers: failed connection to docker socket: Get "http://localhost/v1.22/containers/json": dial unix /var/run/docker.sock: connect: no such file or directory
And this is because the line :

 volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

is not allowed. We cannot bind host path /var/run/docker.sock as a mount point.

it is discussed here: https://stackoverflow.com/questions/53759932/aws-fargate-volumes

This may be well beyond the scope of reproxy.

@umputun
Copy link
Owner

umputun commented Jun 17, 2021

I'm not sure how else reproxy can retrieve the info about other containers without access to docker's socket. In order to discover what containers will be handled it needs the knowledge which is gathered by using docker API from within reproxy.

I read the SO link but the proposed workaround doesn't seem to be applicable for this case.

How do you even know from one container running on the fargate list/ips/names of other containers? I mean if container A needs to access container B directly, how this can be done? Are they on the same docker network and directly available by names? I'm not familiar enough with this magic and have no clue how all of this done on Fargate.

@avowkind
Copy link
Author

avowkind commented Jun 19, 2021 via email

@umputun
Copy link
Owner

umputun commented Jun 19, 2021

I think, you can do smth similar to the provided nginx config in reproxy already with either static or file provider or, if you have consul involved, with the consul-catalog provider.

For the first suggestion - this probably can be a separate provider, but from first sight, it seems to be a little bit too exotic to be included in the core code. From another hand, if someone can develop such a provider and it doesn't involve a lot of code and a lot of dependencies I will consider it. Alternatively, it can be implemented as a part of an external plugin. The current plugin protocol doesn't support custom providers yet but this is something I'm planning to add.

For the second suggestion, unless I missed something fundamental, I can't see how this any different from the current static provider. In case you not familiar with this one it is as simple as this:

reproxy:
    image: umputun/reproxy:latest
    restart: always
    ports:
      - "80:8080"
      - "443:8443"
    environment:
      - STATIC_ENABLED=true
      - STATIC_RULES=
          /mongoa/(.*),http://cvs-mongo/$$1,;
         ^/(.*),http://csv-frontend/$$1,;

if you don't like putting rules this way, you can check the file provider which allows similar rules in yaml you can mount to reproxy container if fargate allows such mapping

@avowkind
Copy link
Author

avowkind commented Jun 19, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants