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

Support exec/attach/portforward in kubectl proxy #49534

Merged
merged 7 commits into from
Aug 9, 2017

Conversation

smarterclayton
Copy link
Contributor

@smarterclayton smarterclayton commented Jul 25, 2017

Use the UpgradeAwareProxy shared code in kubectl proxy. Provide a separate transport for those requests that does not have HTTP/2 enabled. Refactor the code to be a bit cleaner in places and to better separate changes.

Fixes #32026

`kubectl proxy` will now correctly handle the `exec`, `attach`, and `portforward` commands.  You must pass `--disable-filter` to the command in order to allow these endpoints.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 25, 2017
@smarterclayton
Copy link
Contributor Author

smarterclayton commented Jul 25, 2017

@kubernetes/sig-cli-pr-reviews @ncdc

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Jul 25, 2017
@k8s-github-robot k8s-github-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Jul 25, 2017
@smarterclayton smarterclayton force-pushed the separate_proxy branch 5 times, most recently from acde645 to 5ec02e0 Compare July 25, 2017 22:02
@smarterclayton
Copy link
Contributor Author

@kubernetes/sig-testing-misc I don't know how to fix bazel here - that's the result of a clean hack/update-bazel on my end, and it looks correct, but can't figure out why it's broken.

@k8s-ci-robot k8s-ci-robot added the sig/testing Categorizes an issue or PR as relevant to SIG Testing. label Jul 25, 2017
@cblecker
Copy link
Member

Yeah, that's odd. It's passing hack/verify-bazel.sh too in the verify job.

@ixdy
Copy link
Member

ixdy commented Jul 25, 2017

cc @monopole

//pkg/kubectl/util has limited visibility controlled by this rule.

You'll need to add the new package you're adding (//pkg/kubectl/proxy) there.

More details on the visibility rules and motivation in the README.

@smarterclayton
Copy link
Contributor Author

Ah.

@ixdy
Copy link
Member

ixdy commented Jul 27, 2017

/retest

}

// NewServer creates and installs a new Server.
// It automatically registers the created Server to http.DefaultServeMux.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the bit about DefaultServeMux is still accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, will remove

@@ -473,6 +473,43 @@ var _ = SIGDescribe("Kubectl client", func() {
}
})

It("should support exec through kubectl proxy", func() {
// Note: We are skipping local since we want to verify an apiserver with HTTPS.
// At this time local only supports plain HTTP.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea :)

@spiffxp
Copy link
Member

spiffxp commented Jul 27, 2017

/test pull-kubernetes-e2e-gce-etcd3

@dims
Copy link
Member

dims commented Jul 28, 2017

/retest

@smarterclayton
Copy link
Contributor Author

@ncdc other comments or need another reviewer?

framework.Failf("Unexpected kubectl exec output. Wanted %q, got %q", expectedExecOutput, output)
}

// // Verify the proxy server logs saw the connection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smarterclayton do we want to merge with this commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to remove this

@ncdc
Copy link
Member

ncdc commented Aug 1, 2017

@smarterclayton no other comments besides what @dims asked. I think @liggitt/@sttts should review too

@smarterclayton
Copy link
Contributor Author

Applying label as noted

@smarterclayton smarterclayton added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Aug 5, 2017
@smarterclayton
Copy link
Contributor Author

/retest

1 similar comment
@smarterclayton
Copy link
Contributor Author

/retest

@smarterclayton
Copy link
Contributor Author

This broke sometime since my last rebase in master due to an unrelated change (pre-rebase it passes, post it fails). Looking.

@smarterclayton
Copy link
Contributor Author

Broke between 4a8d041 and ae4fac4

@smarterclayton
Copy link
Contributor Author

Broken by #47353 - my theory is a reused kubectl cache, but needs more investigation.

@dims
Copy link
Member

dims commented Aug 7, 2017

Looks like a revert is filed! #50254

@smarterclayton
Copy link
Contributor Author

/retest

4 similar comments
@smarterclayton
Copy link
Contributor Author

/retest

@smarterclayton
Copy link
Contributor Author

/retest

@smarterclayton
Copy link
Contributor Author

/retest

@smarterclayton
Copy link
Contributor Author

/retest

@smarterclayton smarterclayton added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 9, 2017
@smarterclayton
Copy link
Contributor Author

Reapplying label now that the other change was reverted and everything is green

@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@pwittrock
Copy link
Member

@smarterclayton Looks like this test has been failing on GKE. Any ideas why? @apelisse is also seeing this test failing on GCE in his new PR to introduce caching for open-api.

@liggitt
Copy link
Member

liggitt commented Aug 15, 2017

@apelisse is also seeing this test failing on GCE in his new PR to introduce caching for open-api.

Previously, the transport used by that caching approach appeared to have issues with websocket requests

@liggitt
Copy link
Member

liggitt commented Aug 15, 2017

Looks like this test has been failing on GKE. Any ideas why?

GKE is the only CI env I'm aware of that uses a tunneling dialer between the apiserver and the kubelets. It's likely related to that.

@pwittrock
Copy link
Member

@liggitt That is useful thanks. I'll go ask networking.

@pwittrock
Copy link
Member

Moving debugging conversation to #50466

@ckanner
Copy link

ckanner commented Nov 8, 2017

@smarterclayton I start the proxy like this kubectl proxy --address='0.0.0.0' --port=8011 --accept-hosts='^*$' --disable-filter=true. The I exec the command kubectl --server=http://127.0.0.1:8011 exec -it nginx-4217019353-4bbxl /bin/sh, it occurs the error Error from server (BadRequest): Upgrade request required. How can I solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.