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

Auto-configure Magic IP 10.0.2.2 to talk to host OS #351

Closed
edsiper opened this issue Mar 9, 2019 · 5 comments
Closed

Auto-configure Magic IP 10.0.2.2 to talk to host OS #351

edsiper opened this issue Mar 9, 2019 · 5 comments
Labels

Comments

@edsiper
Copy link

edsiper commented Mar 9, 2019

Considering Microk8s a solution to run locally, it lacks a very useful feature to allow Pods connect to Host services smoothly: Magic IP 10.0.2.2 (like minikube).

I was presenting at Scale17x and my Pod Configmap connected to wlan0 interface to connect my local Elasticsearch service, for some reason my IP address changed and could not reach Elasticsearch anymore, this could be solved if 10.0.2.2 existed and always routed to the host OS.

@ktsakalozos
Copy link
Member

Hi @edsiper

I am sorry this happened during a presentation. Having a way for pods to access the host would be a nice feature, and it should be easy to implement.

From a quick search it seems 10.0.2.2 is an IP that VritualBox is adding to allow guests to reach the host. Based on https://askubuntu.com/questions/929296/how-to-define-localhost-ip-as-10-0-2-2/929414 we only need to do a sudo ifconfig lo:1 10.0.2.2 up. We could have a microk8s.enable host-access to create this interface upon user request. Your thoughts?

Thank you

@edsiper
Copy link
Author

edsiper commented Mar 15, 2019

thanks for the quick update. Yep, I think a lo: interface would work, the 'host-access' option looks good too, likely needs to be something different than 10.0.2.2, wondering if upon start and using host-access in Kubernetes can bet set a specific environment variable like MICROK8S_HOST representing the target IP, on that way configmaps only needs to point the variable and not the IP.

@msf
Copy link

msf commented Apr 14, 2019

I support this. having access to hostOS services easily is productivity boon!

@stale
Copy link

stale bot commented Apr 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@ktsakalozos
Copy link
Member

Closed via #1109

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

Successfully merging a pull request may close this issue.

3 participants