-
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 http proxy support for exec/port-forward #11694
Add http proxy support for exec/port-forward #11694
Conversation
|
||
// proxying logic adapted from http://blog.h6t.eu/post/74098062923/golang-websocket-with-http-proxy-support | ||
proxyReq := http.Request{ | ||
Method: "CONNECT", |
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.
I'm not sure if it's appropriate to do a CONNECT
tunnel for regular http traffic. If not, what's the right way to do it?
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.
Doing a quick read I think so
GCE e2e build/test failed for commit 60fe71a049c49129e03fc23a9c2ce4e40af724d3. |
Needs a unit test somehow... no idea how to do that easily though. |
http://www.infoq.com/articles/Web-Sockets-Proxy-Servers seems to cover this for WS |
@smarterclayton I'm not sure how you'd unit test it, since everything would be running on the same host. But I agree some sort of way to test is highly desirable. |
You'd need a connect level proxy - which you could run in a container On Fri, Jul 24, 2015 at 1:18 PM, Andy Goldstein notifications@github.com
Clayton Coleman | Lead Engineer, OpenShift |
I'm thinking that the way to e2e test this is to do the following:
Questions:
|
@kubernetes/rh-cluster-infra @kubernetes/rh-networking |
cc @lavalamp |
Why do you want to restrict packets? |
I'd like to prove without a doubt that proxying is working. If we can't restrict packets, I could write a test that runs |
regarding iptables - it should work inside containers, but it does require On Wed, Aug 26, 2015 at 6:48 AM, Andy Goldstein notifications@github.com
|
Yes, it seems somewhat backwards to require a privileged container to be able to test that proxying is working, but that's all I've been able to come up with so far... |
@ncdc could you elaborate? The intended behaviour of the code in portforward is the same, with the only difference that the old one was broken. |
@mvdan sorry that comment was meant for the go1.5 race pr |
Why not just examine the kubectl log to verify that all traffic went through its proxy? |
@lavalamp good idea |
Do you all have a preference for what image to use for the proxy? Something with squid or polipo in it? |
Actually I'll try nginx since I know e2e already uses that |
Looks like nginx doesn't support CONNECT when acting as a forward proxy. That leaves me with squid, polipo, ... |
60fe71a
to
43f4590
Compare
GCE e2e build/test failed for commit 43f4590318ec10fbd9cd47f7364db6751f7d4ba3. |
GCE e2e build/test passed for commit b9290c46be53cde9eb9611bdde0e7ca3d1ad67aa. |
If we run the forward proxy as a pod, and we run We could try to find a way to run kubectl inside the cluster, but that requires that kubectl be built locally and then somehow run in the cluster, perhaps in a custom image that's built on the fly, pushed to a publicly accessible registry, and then run as a pod. I don't like that idea because of the need to build and push a kubectl image somewhere. Another option would be to run the proxy pod with a hostPort, perhaps, and have kubectl connect to that. Does anyone have any thoughts about how to put together an e2e test where kubectl uses an http proxy to talk to the apiserver? |
Run kubectl in a pod On Aug 27, 2015, at 5:26 PM, Andy Goldstein notifications@github.com If we run the forward proxy as a pod, and we run kubectl exec from outside We could try to find a way to run kubectl inside the cluster, but that Another option would be to run the proxy pod with a hostPort, perhaps, and Does anyone have any thoughts about how to put together an e2e test where — |
@ncdc Thanks. I mainly wanted to get that status in the main comment stream so that I don't get confused again and again 😄 |
GCE e2e build/test failed for commit cd497a6f5768a1b3253740261d7bd3128b080abc. |
@krousey jumping back over now 😄 |
* release tar now includes test/images/* * kubectl is now built as a static binary in the test
cd497a6
to
57fc4bf
Compare
GCE e2e test build/test passed for commit 57fc4bf. |
@k8s-teamcity-mesosphere failure seems like a flake
|
Shippable also looks like a flake. One of them passed in 40 minutes and the other failed in 2 hours. |
@krousey mind taking a look now that this no longer forces a static |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test failed for commit 57fc4bf. |
Unrelated Jenkins e2e error:
|
@k8s-bot test this please |
GCE e2e test build/test passed for commit 57fc4bf. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 57fc4bf. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
…-pick-of-#11694-kubernetes#14984-kubernetes#15152-kubernetes#15445-kubernetes#15875-kubernetes#16473-kubernetes#16979-upstream-release-1.1 Automated cherry pick of kubernetes#11694 kubernetes#14984 kubernetes#15152 kubernetes#15445 kubernetes#15875 kubernetes#16473 kubernetes#16979
…-pick-of-#11694-kubernetes#14984-kubernetes#15152-kubernetes#15445-kubernetes#15875-kubernetes#16473-kubernetes#16979-upstream-release-1.1 Automated cherry pick of kubernetes#11694 kubernetes#14984 kubernetes#15152 kubernetes#15445 kubernetes#15875 kubernetes#16473 kubernetes#16979
Add http proxy support for exec/port-forward in SpdyRoundTripper