-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Proxy for easier access to NodePort services #38
Comments
Networking is really not my area, but it really would be great to be able to run a container I'm working on in my development environment in the network context of the k8s cluster. |
I could move this to a proposal on the main kubernetes repo as well. Just a random idea and there isn't really a chat/mailing list for this repo. :) |
Yeah, working in the context of my Google Container Engine cluster would be fantastic too. I'd definitely support that. |
+1 👯 |
+1. I'd say we should make cluster local services also accessible from the host; essentially hide the fact that a VM is running for the end user. It is after all a |
Where I work, we're working to make pod IPs routable, as something like Project Calico affords. One consequence of this is that we have removed NodePort bits from our Service definitions, and I'd rather not have to reintroduce those bits because I don't want such differences between "development" Service descriptions and "production" Service descriptions. For this single-node k8s cluster manifested by minikube, is there a way to make the Pod IPs accessible from the developer workstation? |
Refactor docker-env & add unset flag
for Option 2: "GoVPN is simple free software virtual private network daemon, aimed to be reviewable, secure, DPI/censorship-resistant, written on Go." |
I've futzed around a solution for doing this right now, with VirtualBox's host only networking + adding a static route on my host machine. Here's what I had to do:
I have written it up using Haven't tested on OS X yet. |
Just stumbled on this issue and wanted to mention that i made my own solution last year. It covers some of the usecases described in the ticket.
This was the original pretext - fast local development within a kubernetes context. There's also an optional feature to route Service traffic back to VPN clients. I did base it on openvpn as there's broad platform support and community knowledge on the subject (easier to adapt to specific needs). Take a look: https://github.com/pieterlange/kube-openvpn |
Since minikube is meant to run in a local environment, on a single VM, I like the approach suggested by @yuvipanda (static local route) much better than the VPN idea for the following reasons:
This is only acceptable in a local environment, which is the main purpose of minikube anyway. And yes it does work on macOS as well. cf. http://stackoverflow.com/a/42658974/4716370 |
+1 |
Could this be solved by running flanneld on both the developer host and the minikube VM? |
Flannel would give you a route to your pod network but:
|
Not built-in, but Telepresence will let you get VPN-like access to your minikube (or any Kubernetes cluster). |
This is more related to #384 and #950, however that was closed, and some people here might find this handy. https://gist.github.com/elsonrodriguez/add59648d097314d2aac9b3c8931278b Basically I've made a one-liner to add the ClusterIP as a route on OSX, and also made a small custom controller to enable LoadBalancer support for minikube (crudely). If there's any interest I can polish up the controller/docs. tl;dr
cc @yuvipanda @tony-kerz @waprin @r2d4 @whitecolor EDIT: updated to remove etcd in the determining of the service ip range. |
I tried Telepresence. It does the trick actually. But somehow it made running my unit test suite much slower (tests run from MacOS and connect to resources in Minikube via clusterIP services). I suspect there's some slowdown when talking over VPN to PostgreSQL running inside the minikube (which uses VirtualBox driver). I didn't investigate further and switched to |
I'm just putting my own setup here in case someone will find it useful. This will make your minikube pod and service IPs routable from your host. Environment
Steps
Test if everything works
Caveats and improvements
|
@ursuad have you managed to make it work with v0.24.1? I'm trying to make it work and so far it looks like |
Question: does the new |
According to docs, In the end I want to access internal Kubernetes DNS hostnames in the host OS. So that, say, in Safari browser I could navigate to Minio admin at I posted a script (#38 (comment)) I used for my case (but note that it doesn't work with Hyperkit driver). |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle rotten |
Just FYI: another VPN written in Go: https://github.com/xitongsys/pangolin I still dream about the day when I could run |
Here is how I do it, using port proxy rules available in Windows to establish SSH connection to a Nodeport service. My setup is Hyper-V on Windows 10 Pro. I hope it gives you some food for thought as a minimum.
I hope it gets you to a working solution for your setup. Definitely there is a lack of support about minikube on Windows. But I am committed to use it since it allows for greater productivity overall. Have a look at this issue if you wonder why I use an internal VM Switch #5072 . |
Slack just open sourced their global overlay network solution https://slack.engineering/introducing-nebula-the-open-source-global-overlay-network-from-slack-884110a5579 It’s a mix of IPSec and TincVPN, but simpler, faster and written in Go. This maybe useful for creating an overlay network between the host and Minikube pods. |
@burdiyan - interesting news! If someone wants to make this work, let me know. Help wanted! |
I was not really using minikube for a while, and checked it out again recently. And I discovered the existence of |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
One of the major hurdles people have using k8s as a development platform is having easy access to DNS and uncomplicated access to "localhost" ports.
This might be something we can tackle in this bug, I discussed the idea here: coreos/coreos-kubernetes#444
Option 1 - Fancy Proxy
This is an idea to make working with the single-node cluster easier. The basic idea would be to have something like
kubectl port-forward
that forwards every nodePort to localhost based on the original targetPort. So, for example:This would be a huge boon to people trying to use kubernetes as a development workflow for running caches, services, etc and developing against those APIs.
Psuedo code event loop:
Option 2 - VPN
Having a simple VPN setup would allow a user to get access to cluster DNS and cluster networking. The downside here is that stuff like OpenVPN, etc is a major hurdle. Anyone know of a simple VPN in Go that works cross platform?
The text was updated successfully, but these errors were encountered: