{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13885","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13885/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13885/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13885/events","html_url":"https://github.com/kubernetes/kubernetes/pull/13885","id":106114912,"number":13885,"title":"WIP - Support exec and pod logging over WebSockets","user":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/api","name":"area/api","color":"e1ed21"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/kubelet-api","name":"area/kubelet-api","color":"fbca04"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/component/apiserver","name":"component/apiserver","color":"0052cc"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XL","name":"size/XL","color":"ee5500"}],"state":"open","locked":false,"assignee":{"login":"ncdc","id":354,"avatar_url":"https://avatars.githubusercontent.com/u/354?v=3","gravatar_id":"","url":"https://api.github.com/users/ncdc","html_url":"https://github.com/ncdc","followers_url":"https://api.github.com/users/ncdc/followers","following_url":"https://api.github.com/users/ncdc/following{/other_user}","gists_url":"https://api.github.com/users/ncdc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncdc/subscriptions","organizations_url":"https://api.github.com/users/ncdc/orgs","repos_url":"https://api.github.com/users/ncdc/repos","events_url":"https://api.github.com/users/ncdc/events{/privacy}","received_events_url":"https://api.github.com/users/ncdc/received_events","type":"User","site_admin":false},"milestone":null,"comments":26,"created_at":"2015-09-12T00:05:52Z","updated_at":"2015-09-16T07:29:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/13885","html_url":"https://github.com/kubernetes/kubernetes/pull/13885","diff_url":"https://github.com/kubernetes/kubernetes/pull/13885.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/13885.patch"},"body":"Simple Websocket framing for multiple channels. No flow control, so slow readers can starve other readers. Will allow exec from a JavaScript console.  Also includes websocket support for streaming logs.  Supports idle timeouts on the connection.  \r\n\r\nBoth `pod/exec` and `pod/log` now respect an additional type of `Connection: Upgrade` - `Upgrade: websocket`. The protocol for the `exec` websocket connection is one of two types:\r\n\r\n* `channel.k8s.io` - each message over the channel starts with a single byte which is the channel identifier (zero indexed) for both reads and writes.  The channels are 0-3.\r\n* `base64.channel.k8s.io` - each message over the channel starts with a single character which is the channel identifier (zero indexed) for both reads and writes.  The channels are `0`-`3`.\r\n\r\nChannel 0 is STDIN, 1 is STDOUT, 2 is STDERR (if TTY is not requested), and 3 is a special error channel.  The server only reads from STDIN, writes to the other three.\r\n\r\nThe protocol for the `log` websocket is one of two types:\r\n\r\n* `binary.k8s.io` - each message is a binary chunk for each chunk of raw log data.\r\n* `base64.binary.k8s.io` - each messages is a base64 encoded response for each chunk of the raw log data.\r\n\r\nWhile this should be considered experimental for 1.1, it's not possible to easily break this out because it's a behavior of the API server.  We should document it is an experimental API while we test and validate it.\r\n\r\nTo see this in use, check out https://github.com/smarterclayton/origin/commit/5bd7bbde5af3aa414b240501585ea669990711c4 (you should to run it locally from index.html if you have cross domain access to your Kube API endpoint).\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/140654737","html_url":"https://github.com/kubernetes/kubernetes/pull/13885#issuecomment-140654737","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/13885","id":140654737,"user":{"login":"stefwalter","id":795070,"avatar_url":"https://avatars.githubusercontent.com/u/795070?v=3","gravatar_id":"","url":"https://api.github.com/users/stefwalter","html_url":"https://github.com/stefwalter","followers_url":"https://api.github.com/users/stefwalter/followers","following_url":"https://api.github.com/users/stefwalter/following{/other_user}","gists_url":"https://api.github.com/users/stefwalter/gists{/gist_id}","starred_url":"https://api.github.com/users/stefwalter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefwalter/subscriptions","organizations_url":"https://api.github.com/users/stefwalter/orgs","repos_url":"https://api.github.com/users/stefwalter/repos","events_url":"https://api.github.com/users/stefwalter/events{/privacy}","received_events_url":"https://api.github.com/users/stefwalter/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T07:29:22Z","updated_at":"2015-09-16T07:29:22Z","body":"> I think there needs to be some indication of when the logs or exec stream has actually started.\r\n\r\nThinking about this a bit more, I think sending a zero length output frame as the first frame would be appropriate. Then clients can know that if they get any output frames (on a log or exec websocket) that the connection to the container has been established."}}