k3s/cmd
Kubernetes Submit Queue 8d10a8f74f
Merge pull request #64006 from Random-Liu/streaming-auth
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add proxy for container streaming in kubelet for streaming auth.

For https://github.com/kubernetes/kubernetes/issues/36666, option 2 of https://github.com/kubernetes/kubernetes/issues/36666#issuecomment-378440458.

This PR:
1. Removed the `DirectStreamingRuntime`, and changed `IndirectStreamingRuntime` to `StreamingRuntime`. All `DirectStreamingRuntime`s, `dockertools` and `rkt`, were removed.
2. Proxy container streaming in kubelet instead of returning redirect to apiserver. This solves the container runtime authentication issue, which is what we agreed on in https://github.com/kubernetes/kubernetes/issues/36666.

Please note that, this PR replaced the redirect with proxy directly instead of adding a knob to switch between the 2 behaviors. For existing CRI runtimes like containerd and cri-o, they should change to serve container streaming on localhost, so as to make the whole container streaming connection secure.

 If a general authentication mechanism proposed in https://github.com/kubernetes/kubernetes/issues/62747 is ready, we can switch back to redirect, and all code can be found in github history.

Please also note that this added some overhead in kubelet when there are container streaming connections. However, the actual bottleneck is in the apiserver anyway, because it does proxy for all container streaming happens in the cluster. So it seems fine to get security and simplicity with this overhead. @derekwaynecarr @mrunalp Are you ok with this? Or do you prefer a knob?

@yujuhong @timstclair @dchen1107 @mikebrow @feiskyer 
/cc @kubernetes/sig-node-pr-reviews 
**Release note**:

```release-note
Kubelet now proxies container streaming between apiserver and container runtime. The connection between kubelet and apiserver is authenticated. Container runtime should change streaming server to serve on localhost, to make the connection between kubelet and container runtime local.

In this way, the whole container streaming connection is secure. To switch back to the old behavior, set `--redirect-container-streaming=true` flag.
```
2018-05-31 22:45:29 -07:00
..
clicheck wire config flags through factory 2018-05-04 17:02:20 -04:00
cloud-controller-manager Merge pull request #64016 from stewart-yu/stewart-controller-manager-codeclean 2018-05-30 18:49:17 -07:00
controller-manager auto generated file 2018-05-18 10:23:38 +08:00
gendocs wire config flags through factory 2018-05-04 17:02:20 -04:00
genkubedocs Remove signal handler registration from pkg/kubelet 2018-05-24 20:44:12 +01:00
genman Remove signal handler registration from pkg/kubelet 2018-05-24 20:44:12 +01:00
genswaggertypedocs Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
genutils Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
genyaml wire config flags through factory 2018-05-04 17:02:20 -04:00
hyperkube Remove signal handler registration from pkg/kubelet 2018-05-24 20:44:12 +01:00
importverifier fix message output for import verifier 2018-05-10 12:50:28 -04:00
kube-apiserver apiextensions-apiserver: add establishing controller to avoid race between established and CRs actually served 2018-05-29 13:46:47 +02:00
kube-controller-manager Merge pull request #64016 from stewart-yu/stewart-controller-manager-codeclean 2018-05-30 18:49:17 -07:00
kube-proxy Merge pull request #61077 from islinwb/fix_ipvs_warninfo 2018-05-31 20:01:26 -07:00
kube-scheduler Fixing scheduling latency metrics 2018-05-30 11:20:12 +02:00
kubeadm Merge pull request #64337 from liztio/save-etcd-dir 2018-05-31 14:12:25 -07:00
kubectl kubectl use its own logs 2018-05-22 11:35:38 +08:00
kubelet Merge pull request #64006 from Random-Liu/streaming-auth 2018-05-31 22:45:29 -07:00
kubemark Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
linkcheck Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
BUILD gke-certificates-controller: rm -rf 2018-02-15 12:01:00 -08:00
OWNERS