-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Separate Direct and Indirect streaming paths, implement indirect path for CRI #36020
Conversation
Reviewed 11 of 20 files at r1. pkg/kubelet/kubelet_pods.go, line 1134 at r1 (raw file):
I'm fine with moving the function call here, but we should be careful and make sure that all outward facing methods call this function. Ideally we should just use a wrapper for all host method to ensure translation is done. This is out of the scope for the current PR though. pkg/kubelet/container/runtime.go, line 124 at r1 (raw file):
Add comment for the interface. pkg/kubelet/container/runtime.go, line 135 at r1 (raw file):
Add comment for the interface. pkg/kubelet/container/runtime.go, line 138 at r1 (raw file):
Can we not use pkg/kubelet/dockertools/docker_manager.go, line 267 at r1 (raw file):
Need to ensure that docker manager implements pkg/kubelet/kuberuntime/kuberuntime_manager.go, line 116 at r1 (raw file):
include pkg/kubelet/rkt/rkt.go, line 278 at r1 (raw file):
Need to ensure that rkt implements Comments from Reviewable |
Made the first pass. Most changes seem reasonable/straightforward. The cleanup of |
Thanks, addressed all comments. Review status: 11 of 26 files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. pkg/kubelet/kubelet_pods.go, line 1134 at r1 (raw file):
|
type IndirectStreamingRuntime interface { | ||
GetExec(id ContainerID, cmd []string, stdin, stdout, stderr, tty bool) (*url.URL, error) | ||
GetAttach(id ContainerID, stdin, stdout, stderr bool) (*url.URL, error) | ||
GetPortForward(podName, podNamespace string, podUID types.UID) (*url.URL, error) |
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.
Where is port
? Is it handled somewhere else?
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.
Unfortunately the ports aren't included in the initial request, so without some changes to the client API we don't have that information here. I left a TODO here to deal with it later.
@@ -181,6 +181,7 @@ type Runtime struct { | |||
} | |||
|
|||
var _ kubecontainer.Runtime = &Runtime{} | |||
var _ kubecontainer.DirectStreamingRuntime = &Runtime{} |
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.
Have a question: is there any initialization problem of assigning kubecontainer.DirectStreamingRuntime
in both dockertools and rkt package?
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.
This is just asserting that &Runtime{}
implements the kubecontainer.DirectStreamingRuntime
interface. Nothing is being assigned.
LGTM |
e83318a
to
2273427
Compare
Squashed & rebased. |
2273427
to
a53aa1d
Compare
Added comment to fix |
Belated LGTM with that comment fix too, I gave it a go and got it the exec part of it at least to work e2e for me. |
a53aa1d
to
caf9f6e
Compare
Thanks, fixed. Reapplying LGTM (trivial comment change). |
@k8s-bot verify test this |
I still can't tell what's failing, but I tried cleaning up the unkeyed field warnings. |
Jenkins unit/integration failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE e2e failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
Jenkins GKE smoke e2e failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
Jenkins GCI GKE smoke e2e failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE Node e2e failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
Jenkins GCE etcd3 e2e failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
Jenkins Kubemark GCE e2e failed for commit fc34165f964b087ea02ed19ebf4896599caffc65. Full PR test history. The magic incantation to run this job again is |
fc34165
to
3d80ec4
Compare
3d80ec4
to
86d849e
Compare
Hmm, that seemed to fix the verify error. Squashed the commit. PTAL. |
Jenkins GCI GCE e2e failed for commit 86d849e. Full PR test history. The magic incantation to run this job again is |
@k8s-bot gci gce e2e test this |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue |
Automatic merge from submit-queue kubelet: don't print httplogs for redirects Goes with #36020, but can merge independently. cc @timstclair
@timstclair I think this PR broke the CRI tests.
I should've triggered the CRI tests with |
@timstclair Will this issue be fixed by #36253? |
Just saw your comment. Yeah, it seems so. But I've already sent a quick fix #36274. Haha |
Automatic merge from submit-queue CRI: Add remote streaming implementation. Fixes the cri test failure introduced in #36020. @yujuhong @timstclair @feiskyer /cc @kubernetes/sig-node
This PR refactors the
pkg/kubelet/container.Runtime
interface to remove theExecInContainer
,PortForward
andAttachContainer
methods. Instead, those methods are part of theDirectStreamingRuntime
interface which all "legacy" runtimes implement. I also added anIndirectStreamingRuntime
which handles the redirect path and is implemented by CRI runtimes. To control the size of this PR, I did not fully setup the indirect streaming path for the dockershim, so I left legacy path behind.Most of this PR is moving & renaming associated with the refactoring. To understand the functional changes, I suggest tracing the code from
getExec
inpkg/kubelet/server/server.go
, which callsGetExec
inpkg/kubelet/kubelet_pods.go
to determine whether to follow the direct or indirect path.For #29579
/cc @kubernetes/sig-node
This change is