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

Provide IP for each docker via label #17

Closed
Svenum opened this issue Oct 2, 2022 · 8 comments · Fixed by #19
Closed

Provide IP for each docker via label #17

Svenum opened this issue Oct 2, 2022 · 8 comments · Fixed by #19

Comments

@Svenum
Copy link

Svenum commented Oct 2, 2022

It would be nice to add for each docker a own "bind_ip". Maybe via label. So that you can multiple IPs.
example:

labels:
    kop.bind.ip: 10.10.10.16
    ...

If you don't have this feature you need a second reverse-proxy, or not?

@dorianim
Copy link
Contributor

dorianim commented Oct 2, 2022

Why would you need that?
This tool is meant to manage containers on one machine, so they should all have the same ip ...

@Svenum
Copy link
Author

Svenum commented Oct 3, 2022

I want to use different ips for each docker, that I don't have to look after witch port is available and witch not.

@dorianim
Copy link
Contributor

dorianim commented Oct 3, 2022

This is not how it works ...
All the ports have to be available on the host machine so they can be accessed by Traefik

@Svenum
Copy link
Author

Svenum commented Oct 4, 2022

But i want for security reasons, that some container get their own ip (for example: Firewall-Rules). I know, that this is not the typical way to use Docker. But I believe that more people then I need this. Maybe that you can set an default with the BIND_IP ENV, but that you can override the default with an Label.

@chetan
Copy link
Contributor

chetan commented Oct 4, 2022

@Svenum I think I understand what you're asking for but how are you assigning the IPs to the containers? Are you not using some CNI plugin which assigns routable IPs? As long as docker is doing the assigning, the correct IP should be picked up.

You can confirm what traefik-kop sees by checking the output of docker inspect <container id>. The logs of the latest version of traefik-kop should also show you what host:ip combination are being published.

@chetan
Copy link
Contributor

chetan commented Oct 4, 2022

@Svenum there's another provider config option called useBindPortIP that I was previously unaware of. Would exposing this option solve your problem?

@Svenum
Copy link
Author

Svenum commented Oct 4, 2022

@chetan yes, that is what i am looking for, will try it and tell the result.

@Svenum
Copy link
Author

Svenum commented Oct 4, 2022

That is not working because traefik-kop is everytime sending the "BIND_IP" IP to traefik.
I want somthing like this:

                        +---------------------+                      +---------------------+
                        |                     |                      |                     |
+---------+     :443    |  +---------+        |   XXX.XXX.0.10:8088  |  +------------+     |
|   WAN   |--------------->| traefik |<---------+---------------------->| svc-nginx  |     |
+---------+             |  +---------+        | |                    |  +------------+     |
                        |       |             | |                    |                     |
                        |  +---------+        | | XXX.XXX.0.13:443   |  +-------------+    |
                        |  |  redis  |        | +---------------------->| svc-apache  |    |
                        |  +---------+        |                      |  +-------------+    |
                        |       ^     docker1 |                      |             docker2 |
                        +-------|-------------+                      |  +-------------+    |
                                +-------------------------------------->| traefik-kop |    |
                                                                     |  +-------------+    |
                                                                     +---------------------+

This was referenced Oct 9, 2022
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

Successfully merging a pull request may close this issue.

3 participants