-
Notifications
You must be signed in to change notification settings - Fork 116
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
[ADD] Feature to expose database #479
Conversation
Can you check CI? |
9389797
to
e653c6e
Compare
e653c6e
to
6e59284
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks a lot for improving this feature
ping @pedrobaeza |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this doesn't work in Traefik 2-, you can put for them the port direct mapping instead of limiting the question to Traefik 3
380708d
to
f25fc7b
Compare
It seems OK in code review, but you should try to generate a scaffolding on each type to be sure, or add them to tests. |
f25fc7b
to
7dbcc1c
Compare
9173d19
to
d962bbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't mean to sound rude, but I have the feeling all this is wrong... 😅
- TCP routers don't have a concept of "path".
- Are you sure TLS termination can be done in Traefik for a TCP router?
- Are you seriously exposing the database always, by default and with no opt-out option?
d962bbb
to
081f737
Compare
First of all, thanks for pointing out that TCP routers don't have the concept of a path. I have already corrected that. Secondly, I would say that Traefik 3 can handle TLS termination for TCP routers. This functionality is documented in the official Traefik documentation here. But please correct me if I'm wrong, although I believe it is correct. Lastly, no, by default I do not expose the database. It is only exposed if the option to expose it is chosen, as you can see here: doodba-copier-template/prod.yaml.jinja Line 90 in 081f737
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for attending the previous comment! Yes, it seems I was wrong in those last 2 points.
I see this also would need some changes on the traefik deployment, so you probably need to update the docs, as now there must exist a postgres-entrypoint
.
Thank you
081f737
to
c3cf462
Compare
This is ready to merge @pedrobaeza . I have generated a scaffolding on each type and works correctly. |
@yajo is it OK for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment.
One bigger concern is that there are no tests for this. I think it deserves one.
21f9e1f
to
222ded6
Compare
14c411f
to
cd64c5b
Compare
@ap-wtioit Do you have any idea why I can't connect to the database in the new test? |
@josep-tecnativa i'm not 100% sure. One issue we had on our systems was this one: moby/moby#47145 where starting with docker 25 it was no longer possible to access container ports directly from the host for internal networks. Another issue could be test tested postgres image. If the postgres stopped after the test started it there could also be a connection issue To be sure i would add the following debugging info to the failed test:
|
54c1956
to
7f53322
Compare
7f53322
to
ca7c4cf
Compare
Since Docker does not allow connections through ports on the same host starting from version 25, it is currently not possible to create a test. The functionality of this PR has been tested by both @celm1990 and me. Therefore, I believe it is ready to be merged (once CI finishes), and if in the future I find a way to create the test, I will implement it. ping @pedrobaeza |
Since Traefik 3 is avaliable on Doodba Copier Template, we can configure with our template, a postgres exposed database. This is only working on Traefik 3.