{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/79993198","id":79993198,"diff_hunk":"@@ -0,0 +1,64 @@\n+# Add `kubectl` command to open UI\n+\n+## Motivation\n+\n+As it was mentioned in [#28007](https://github.com/kubernetes/kubernetes/issues/28007) `kubectl` should have an option to open the UI that is installed under `http://<master_ip>/ui`, for example `kubectl open-ui`. This would be great discoverability improvement for the UI since many people start with CLI, not even knowing that there is a UI.\n+\n+## Proposed Solution\n+\n+`kubectl open-ui` command could use different solutions. First one is to run local proxy (`kubectl proxy`) and then open a browser with UI's URL. Second one (not covering all use cases) is to look for UI's service, get it's external endpoint, if it exists, and open a browser with it.\n+\n+A mix of these two solutions seems to be the best, so if there is an external endpoint of UI's service it can be opened without starting local proxy. Otherwise, proxy can be started to access UI anyways.\n+\n+###  Command handler's pseudocode\n+\n+``` go\n+func OpenUI(w io.Writer, kubeClient client.Interface) {\n+\t// Check if UI service exists in the cluster\n+\t_, err := kubeClient.Services(api.NamespaceSystem).Get(DashboardServiceName)\n+\tif err != nil {\n+\t\tfmt.Printf(\"Couldn't find UI service in system namespace: %v\\n\", err)\n+\t\tos.Exit(1)\n+\t}\n+\n+\t// Check if there are any UI service endpoints\n+\tuiAddress, err := getUIEndpoints(kubeClient)\n+\tif err != nil {\n+\t\t// Run proxy in background\n+\t\t...\n+\t}\n+\n+    // Run browser with UI's URL\n+    ...\n+}\n+```\n+\n+### Getting external endpoint of UI's service\n+\n+First thing, that needs to be verified is availability of UI's service in the cluster. It should be done by checking if there is a `kubernetes-dashboard` service in the `kube-system` namespace. If it cannot be found, then opening UI is not possible and user should be informed about it in returned error.\n+\n+After UI's service is found it could be checked if it has any external `kubernetes-dashboard` endpoints in the `kube-system` namespace with valid port and address. In this case, assuming that everything is valid, in this case UI's URL is `http://<endpoint-adress>:<endpoint-port>/`","path":"docs/proposals/open-ui-command.md","position":40,"original_position":40,"commit_id":"499054e0b20a4bf37aa14f0f0830ed6796aec5ed","original_commit_id":"499054e0b20a4bf37aa14f0f0830ed6796aec5ed","user":{"login":"maciaszczykm","id":2823399,"avatar_url":"https://avatars.githubusercontent.com/u/2823399?v=3","gravatar_id":"","url":"https://api.github.com/users/maciaszczykm","html_url":"https://github.com/maciaszczykm","followers_url":"https://api.github.com/users/maciaszczykm/followers","following_url":"https://api.github.com/users/maciaszczykm/following{/other_user}","gists_url":"https://api.github.com/users/maciaszczykm/gists{/gist_id}","starred_url":"https://api.github.com/users/maciaszczykm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maciaszczykm/subscriptions","organizations_url":"https://api.github.com/users/maciaszczykm/orgs","repos_url":"https://api.github.com/users/maciaszczykm/repos","events_url":"https://api.github.com/users/maciaszczykm/events{/privacy}","received_events_url":"https://api.github.com/users/maciaszczykm/received_events","type":"User","site_admin":false},"body":"> If someone has chosen to do that, they would reasonably expect that their users are coming to the dashboard using a hostname and path.\r\n\r\nI agree, but he still can do it using his own/old way. This command target is to give him another possibility, which is opening UI from CLI. There are many `kubectl` users, that aren't aware of UI existence I believe.\r\n\r\nCC @bryk ","created_at":"2016-09-22T08:18:27Z","updated_at":"2016-09-22T08:18:27Z","html_url":"https://github.com/kubernetes/kubernetes/pull/32073#discussion_r79993198","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/79993198"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/32073#discussion_r79993198"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073","id":83986654,"html_url":"https://github.com/kubernetes/kubernetes/pull/32073","diff_url":"https://github.com/kubernetes/kubernetes/pull/32073.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/32073.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/32073","number":32073,"state":"open","locked":false,"title":"Add kubectl open-ui command proposal","user":{"login":"maciaszczykm","id":2823399,"avatar_url":"https://avatars.githubusercontent.com/u/2823399?v=3","gravatar_id":"","url":"https://api.github.com/users/maciaszczykm","html_url":"https://github.com/maciaszczykm","followers_url":"https://api.github.com/users/maciaszczykm/followers","following_url":"https://api.github.com/users/maciaszczykm/following{/other_user}","gists_url":"https://api.github.com/users/maciaszczykm/gists{/gist_id}","starred_url":"https://api.github.com/users/maciaszczykm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maciaszczykm/subscriptions","organizations_url":"https://api.github.com/users/maciaszczykm/orgs","repos_url":"https://api.github.com/users/maciaszczykm/repos","events_url":"https://api.github.com/users/maciaszczykm/events{/privacy}","received_events_url":"https://api.github.com/users/maciaszczykm/received_events","type":"User","site_admin":false},"body":"This is a design proposal for `kubectl open-ui` command, which would make possible opening UI's web page in user's default browser directly from CLI. Related to #28007 issue.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.kubernetes.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/32073)\n<!-- Reviewable:end -->\n","created_at":"2016-09-05T11:12:06Z","updated_at":"2016-09-22T08:18:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"088b7dffa541878533e183cf968901708523bebb","assignee":{"login":"pwittrock","id":7882754,"avatar_url":"https://avatars.githubusercontent.com/u/7882754?v=3","gravatar_id":"","url":"https://api.github.com/users/pwittrock","html_url":"https://github.com/pwittrock","followers_url":"https://api.github.com/users/pwittrock/followers","following_url":"https://api.github.com/users/pwittrock/following{/other_user}","gists_url":"https://api.github.com/users/pwittrock/gists{/gist_id}","starred_url":"https://api.github.com/users/pwittrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwittrock/subscriptions","organizations_url":"https://api.github.com/users/pwittrock/orgs","repos_url":"https://api.github.com/users/pwittrock/repos","events_url":"https://api.github.com/users/pwittrock/events{/privacy}","received_events_url":"https://api.github.com/users/pwittrock/received_events","type":"User","site_admin":false},"assignees":[{"login":"pwittrock","id":7882754,"avatar_url":"https://avatars.githubusercontent.com/u/7882754?v=3","gravatar_id":"","url":"https://api.github.com/users/pwittrock","html_url":"https://github.com/pwittrock","followers_url":"https://api.github.com/users/pwittrock/followers","following_url":"https://api.github.com/users/pwittrock/following{/other_user}","gists_url":"https://api.github.com/users/pwittrock/gists{/gist_id}","starred_url":"https://api.github.com/users/pwittrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwittrock/subscriptions","organizations_url":"https://api.github.com/users/pwittrock/orgs","repos_url":"https://api.github.com/users/pwittrock/repos","events_url":"https://api.github.com/users/pwittrock/events{/privacy}","received_events_url":"https://api.github.com/users/pwittrock/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/32073/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/499054e0b20a4bf37aa14f0f0830ed6796aec5ed","head":{"label":"maciaszczykm:kubectl-open-ui-design-doc","ref":"kubectl-open-ui-design-doc","sha":"499054e0b20a4bf37aa14f0f0830ed6796aec5ed","user":{"login":"maciaszczykm","id":2823399,"avatar_url":"https://avatars.githubusercontent.com/u/2823399?v=3","gravatar_id":"","url":"https://api.github.com/users/maciaszczykm","html_url":"https://github.com/maciaszczykm","followers_url":"https://api.github.com/users/maciaszczykm/followers","following_url":"https://api.github.com/users/maciaszczykm/following{/other_user}","gists_url":"https://api.github.com/users/maciaszczykm/gists{/gist_id}","starred_url":"https://api.github.com/users/maciaszczykm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maciaszczykm/subscriptions","organizations_url":"https://api.github.com/users/maciaszczykm/orgs","repos_url":"https://api.github.com/users/maciaszczykm/repos","events_url":"https://api.github.com/users/maciaszczykm/events{/privacy}","received_events_url":"https://api.github.com/users/maciaszczykm/received_events","type":"User","site_admin":false},"repo":{"id":55212916,"name":"kubernetes","full_name":"maciaszczykm/kubernetes","owner":{"login":"maciaszczykm","id":2823399,"avatar_url":"https://avatars.githubusercontent.com/u/2823399?v=3","gravatar_id":"","url":"https://api.github.com/users/maciaszczykm","html_url":"https://github.com/maciaszczykm","followers_url":"https://api.github.com/users/maciaszczykm/followers","following_url":"https://api.github.com/users/maciaszczykm/following{/other_user}","gists_url":"https://api.github.com/users/maciaszczykm/gists{/gist_id}","starred_url":"https://api.github.com/users/maciaszczykm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maciaszczykm/subscriptions","organizations_url":"https://api.github.com/users/maciaszczykm/orgs","repos_url":"https://api.github.com/users/maciaszczykm/repos","events_url":"https://api.github.com/users/maciaszczykm/events{/privacy}","received_events_url":"https://api.github.com/users/maciaszczykm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maciaszczykm/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/maciaszczykm/kubernetes","forks_url":"https://api.github.com/repos/maciaszczykm/kubernetes/forks","keys_url":"https://api.github.com/repos/maciaszczykm/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maciaszczykm/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maciaszczykm/kubernetes/teams","hooks_url":"https://api.github.com/repos/maciaszczykm/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/maciaszczykm/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/maciaszczykm/kubernetes/events","assignees_url":"https://api.github.com/repos/maciaszczykm/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/maciaszczykm/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/maciaszczykm/kubernetes/tags","blobs_url":"https://api.github.com/repos/maciaszczykm/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maciaszczykm/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maciaszczykm/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/maciaszczykm/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maciaszczykm/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/maciaszczykm/kubernetes/languages","stargazers_url":"https://api.github.com/repos/maciaszczykm/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/maciaszczykm/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/maciaszczykm/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/maciaszczykm/kubernetes/subscription","commits_url":"https://api.github.com/repos/maciaszczykm/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/maciaszczykm/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/maciaszczykm/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/maciaszczykm/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/maciaszczykm/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/maciaszczykm/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maciaszczykm/kubernetes/merges","archive_url":"https://api.github.com/repos/maciaszczykm/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maciaszczykm/kubernetes/downloads","issues_url":"https://api.github.com/repos/maciaszczykm/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/maciaszczykm/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/maciaszczykm/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/maciaszczykm/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maciaszczykm/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/maciaszczykm/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/maciaszczykm/kubernetes/deployments","created_at":"2016-04-01T07:35:09Z","updated_at":"2016-04-01T07:35:22Z","pushed_at":"2016-09-21T14:49:01Z","git_url":"git://github.com/maciaszczykm/kubernetes.git","ssh_url":"git@github.com:maciaszczykm/kubernetes.git","clone_url":"https://github.com/maciaszczykm/kubernetes.git","svn_url":"https://github.com/maciaszczykm/kubernetes","homepage":"http://kubernetes.io","size":319086,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"008fc22d31e45117c63fee616c817479556c15d1","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-09-22T06:35:16Z","pushed_at":"2016-09-22T07:56:25Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":567237,"stargazers_count":16978,"watchers_count":16978,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5491,"mirror_url":null,"open_issues_count":4568,"forks":5491,"open_issues":4568,"watchers":16978,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/32073"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/32073"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/32073/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/32073/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/499054e0b20a4bf37aa14f0f0830ed6796aec5ed"}}}}
{"actor":{"display_login":"maciaszczykm"}}