-
Notifications
You must be signed in to change notification settings - Fork 40k
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 a bastion to apiserver (reverse lookup by IP address + proxy) #3481
Comments
@smarterclayton thoughts? |
Interesting. @ncdc's work with http upgrade to TCP via some protocol would eventually let that and normal proxy talk TCP through the bastion and still do security. I don't see a downside other than naming and trying to figure out whether you have access to the bastion (since we can't do a reverse lookup of IP to pod to namespace today). Maybe just replace IP with name of pod and make pods support proxy? |
This already works today, actually. |
What about port selection?
|
.../proxy/pods/podname:port/... actually works! |
I love it when a plan comes together
|
The original reason I asked about proxying by IP was for the case of a non-k8s-aware app that generates links to other pods by their IPs, but doesn't know how to refer to pods by pod name. As an alternative, I can adapt the app to be k8s-aware enough to link through the apiserver proxy by pod name. However, then I came upon the need for something like #3484. |
Yeah, and the more I think about it the more I think that's a valid use case. |
How does the non k8s-aware app find the pod ips?
|
Each server is given the address of an etcd service on the command line. The server resolves its own IP and registers itself on the specified etcd service. Then the management interface reads the IPs out of etcd and links to them. |
I guess we eventually need to support efficient pod access by currentIP, but it certainly complicates the authz story. @erictune this is a case where the resource identifier is insufficient to properly scope a request, so the indirection has to happen inside RESTStorage before the authz check can happen. Also, what are the performance implications of doing this lookup and that sort of check on every single http request? We can't easily cache the acl decision above the storage layer in this case, so we'd have to cache both lookup and decision. I can see the value in the scenario, but definitely is complex in implications.
|
Why do we need this? Pods and Services are supported. Stop. |
Reverse lookup in APIserver makes sense. It is just a query against the data in the apiserver. Proxying, while possible to do in apiserver, I think belongs in a separate process.
|
+1 ----- Original Message -----
|
+1 to separate process. Discussion #4440 re. proxy and redirect is relevant. |
We have started discussing this (@liggitt has incoming recommendations to the securing the kubelet) and have some recommendations. Concrete proposal:
There would be a new API REST helper that handles proxying, supports connection upgrade, can do security delegation. Coincidentally, we have one of these in OpenShift we use to talk to Kuberetes, so we can back port it. |
/logs and /exec are extremely common, so specialized API subresources seem fine for those. Internally, it's also very common for app admins/ops and devs (when debugging problems in production) to access status, stats, profiling, etc. URLs on application instances. Some apps also have control interfaces accessible via HTTP. Those ports/paths shouldn't be available via the normal public/external IP:ports. |
Proxy as a subresources for pods is strictly better than the global verb I think.
|
@csrwng is going to start working on this. |
#5763 is setting the stage for this work. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
e.g., to access 10.1.2.3:8080 on the internal cluster network, go to /api/v1beta1/proxy/bastion/10.1.2.3:8080/
The text was updated successfully, but these errors were encountered: