-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: Enable local docker ip in for communication with outside k3d #11350
feat: Enable local docker ip in for communication with outside k3d #11350
Conversation
Signed-off-by: Matthias Dietz <m.dietz@ewerk.com>
Signed-off-by: Matthias Dietz <m.dietz@ewerk.com>
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.
@devops-42 Please sign-off your commits. |
1e6356a
to
27999f7
Compare
@terrytangyuan Commits are signed off now. |
Thanks. Let's wait for others to review. |
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.
The code looks sane enough, but I think there should be some documentation added to docs/running-locally.md to explain that this is possible and why you might want to use it.
I suppose I'm not sure of the use case that this really helps with that just running the same thing inside k3d doesn't. Documentation is needed anyway, but explaining when to use it may help me understand it too.
Signed-off-by: Matthias Dietz <m.dietz@ewerk.com>
Signed-off-by: Matthias Dietz <m.dietz@ewerk.com>
@Joibel Thanks for your comments! I have added some documentation which hopefully should clarify the use-case. |
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
@devops-42 thank you for contributing. |
Motivation
This PR introduces the possibility to connect to services outside the
k3d
cluster used in DevContainer by setting up a distinct hostname.Modifications
The magic hostname
host.docker.internal
is re-used and injected in thedevcontainer.json
and the CoreDNS configmap.Verification
Within the same Docker environment a Web container running
nginx
has been created. After that, VSCode with DevContainer is started. When DevContainer is up and running, exec a shell in a pod and issue: