{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/54785506","id":54785506,"diff_hunk":"@@ -0,0 +1,231 @@\n+<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->\n+\n+<!-- BEGIN STRIP_FOR_RELEASE -->\n+\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+<img src=\"http://kubernetes.io/img/warning.png\" alt=\"WARNING\"\n+     width=\"25\" height=\"25\">\n+\n+<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>\n+\n+If you are using a released version of Kubernetes, you should\n+refer to the docs that go with that version.\n+\n+Documentation for other releases can be found at\n+[releases.k8s.io](http://releases.k8s.io).\n+</strong>\n+--\n+\n+<!-- END STRIP_FOR_RELEASE -->\n+\n+<!-- END MUNGE: UNVERSIONED_WARNING -->\n+\n+# Kubelet TLS bootstrap\n+\n+Author: George Tankersley (george.tankersley@coreos.com)\n+\n+## Preface\n+\n+This document describes a method for a kubelet to bootstrap itself\n+into a TLS-secured cluster. Crucially, it automates the provision and\n+distribution of signed certificates.\n+\n+## Overview\n+\n+When a kubelet runs for the first time, it must be given TLS assets\n+or generate them itself. In the first case, this is a burden on the cluster\n+admin and a significant logistical barrier to secure Kubernetes rollouts. In\n+the second, the kubelet must self-sign its certificate and forfeits many of the\n+advantages of a PKI system. Instead, we propose that the kubelet generate a\n+private key and a CSR for submission to a cluster-level certificate signing\n+process.\n+\n+## Preliminaries\n+\n+We assume the existence of a functioning control plane. The\n+apiserver should be configured for TLS initially or possess the ability to\n+generate valid TLS credentials for itself. If secret information is passed in\n+the request (e.g. auth tokens supplied with the request or included in\n+ExtraInfo) then all communications from the node to the apiserver must take\n+place over a verified TLS connection.\n+\n+Each node is additionally provisioned with the following information:\n+\n+1. Location of the apiserver\n+2. Any CA certificates necessary to trust the apiserver's TLS certificate\n+3. Access tokens (if needed) to communicate with the CSR endpoint\n+\n+These should not change often and are thus simple to include in a static\n+provisioning script.\n+\n+## API Changes\n+\n+### CertificateSigningRequest Object\n+\n+We introduce a new API object to represent PKCS#10 certificate signing\n+requests. It will be accessible under:\n+\n+`/api/vX/certificaterequests/mycsr`\n+\n+It will have the following structure:\n+\n+```go\n+// Describes a certificate signing request\n+type CertificateSigningRequest struct {\n+        api.TypeMeta         `json:\",inline\"`\n+        api.ObjectMeta       `json:\"metadata,omitempty\"`\n+\n+        // Specifies the behavior of the CSR\n+        Spec CertificateSigningRequestSpec\n+\n+        // Most recently observed status of the CSR\n+        Status CertificateSigningRequestStatus\n+}\n+\n+type CertificateSigningRequestSpec struct {\n+        // Raw PKCS#10 CSR data\n+        CertificateRequest []byte\n+\n+        // Fingerprint of the public key that signed the CSR\n+        Fingerprint string\n+\n+        // Subject fields from the CSR\n+        Subject pkix.Name\n+\n+        // DNS SANs from the CSR\n+        Hostnames []string\n+\n+        // IP SANs from the CSR\n+        IPAddresses []string\n+\n+        // Extra information the node wishes to send with the request\n+        ExtraInfo []string\n+}\n+\n+type CertificateSigningRequestStatus struct {\n+        // Indicates whether CSR has a response yet. Default is Unknown. Status\n+        // is True for approval and False for rejections.\n+        Status api.ConditionStatus\n+\n+        // If CSR was rejected, these contain the reason why (if any was supplied).\n+        Reason string\n+        Message string\n+\n+        // If CSR was approved, this contains the issued certificate.\n+        Certificate []byte\n+}\n+```\n+\n+We also introduce CertificateSigningRequestList to allow listing all the CSRs in the cluster:\n+\n+```go\n+type CertificateSigningRequestList struct {\n+        api.TypeMeta\n+        api.ListMeta\n+\n+        Items []CertificateSigningRequest\n+}\n+```\n+\n+## Certificate Request Process\n+\n+### Node intialization\n+\n+When the kubelet executes it checks a location on disk for TLS assets\n+(currently `/var/run/kubernetes/kubelet.{key,crt}` by default). If it finds\n+them, it proceeds. If there are no TLS assets, the kubelet generates a keypair\n+and self-signed certificate. We propose the following optional fallback behavior:\n+\n+1. Generate a keypair\n+2. Generate a CSR for that keypair with CN set to the hostname (or\n+   `--hostname-override` value) and DNS/IP SANs supplied with whatever values\n+   the host knows for itself.\n+3. Post the CSR to the CSR API endpoint.\n+4. Set a watch on the CSR object to be notified of approval or rejection.\n+\n+### Controller response\n+\n+The apiserver must first validate the signature on the raw CSR data and reject\n+requests featuring invalid CSRs. It then persists the\n+CertificateSigningRequests and exposes the List of all CSRs for an\n+administrator to approve or reject. The apiserver should watch for updates the\n+Status field of any CertificateSigningRequest. When a CSR is approved\n+(signified by Status changing from Unknown to True) the apiserver should","path":"docs/proposals/kubelet-tls-bootstrap.md","position":160,"original_position":160,"commit_id":"c553c5b575bc4d3d33f6b37cce41af613a55af86","original_commit_id":"c553c5b575bc4d3d33f6b37cce41af613a55af86","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"body":"Is the API server doing the signing or is that being done by a controller which then does a straight update?  The latter seems more \"natural\", but it also suggests that `ConditionStatus` isn't rich enough to describe the states which appear to be:\r\n 1. approval-pending\r\n 1. approved\r\n 1. denied\r\n 1. signed","created_at":"2016-03-02T20:27:46Z","updated_at":"2016-03-02T20:27:46Z","html_url":"https://github.com/kubernetes/kubernetes/pull/20439#discussion_r54785506","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/54785506"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/20439#discussion_r54785506"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439","id":57905089,"html_url":"https://github.com/kubernetes/kubernetes/pull/20439","diff_url":"https://github.com/kubernetes/kubernetes/pull/20439.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/20439.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/20439","number":20439,"state":"open","locked":false,"title":"Add proposal for kubelet TLS bootstrap","user":{"login":"gtank","id":622063,"avatar_url":"https://avatars.githubusercontent.com/u/622063?v=3","gravatar_id":"","url":"https://api.github.com/users/gtank","html_url":"https://github.com/gtank","followers_url":"https://api.github.com/users/gtank/followers","following_url":"https://api.github.com/users/gtank/following{/other_user}","gists_url":"https://api.github.com/users/gtank/gists{/gist_id}","starred_url":"https://api.github.com/users/gtank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtank/subscriptions","organizations_url":"https://api.github.com/users/gtank/orgs","repos_url":"https://api.github.com/users/gtank/repos","events_url":"https://api.github.com/users/gtank/events{/privacy}","received_events_url":"https://api.github.com/users/gtank/received_events","type":"User","site_admin":false},"body":"A proposal based on the discussion of issue #18112, to implement a process by which kubelets can obtain TLS certificates in a streamlined manner.","created_at":"2016-02-01T21:46:04Z","updated_at":"2016-03-02T20:27:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca1316bc64cfd99e57686f9ee5c836680e10a073","assignee":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/20439/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c553c5b575bc4d3d33f6b37cce41af613a55af86","head":{"label":"gtank:kubelet-tls-bootstrap","ref":"kubelet-tls-bootstrap","sha":"c553c5b575bc4d3d33f6b37cce41af613a55af86","user":{"login":"gtank","id":622063,"avatar_url":"https://avatars.githubusercontent.com/u/622063?v=3","gravatar_id":"","url":"https://api.github.com/users/gtank","html_url":"https://github.com/gtank","followers_url":"https://api.github.com/users/gtank/followers","following_url":"https://api.github.com/users/gtank/following{/other_user}","gists_url":"https://api.github.com/users/gtank/gists{/gist_id}","starred_url":"https://api.github.com/users/gtank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtank/subscriptions","organizations_url":"https://api.github.com/users/gtank/orgs","repos_url":"https://api.github.com/users/gtank/repos","events_url":"https://api.github.com/users/gtank/events{/privacy}","received_events_url":"https://api.github.com/users/gtank/received_events","type":"User","site_admin":false},"repo":{"id":50872973,"name":"kubernetes","full_name":"gtank/kubernetes","owner":{"login":"gtank","id":622063,"avatar_url":"https://avatars.githubusercontent.com/u/622063?v=3","gravatar_id":"","url":"https://api.github.com/users/gtank","html_url":"https://github.com/gtank","followers_url":"https://api.github.com/users/gtank/followers","following_url":"https://api.github.com/users/gtank/following{/other_user}","gists_url":"https://api.github.com/users/gtank/gists{/gist_id}","starred_url":"https://api.github.com/users/gtank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gtank/subscriptions","organizations_url":"https://api.github.com/users/gtank/orgs","repos_url":"https://api.github.com/users/gtank/repos","events_url":"https://api.github.com/users/gtank/events{/privacy}","received_events_url":"https://api.github.com/users/gtank/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gtank/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/gtank/kubernetes","forks_url":"https://api.github.com/repos/gtank/kubernetes/forks","keys_url":"https://api.github.com/repos/gtank/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gtank/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gtank/kubernetes/teams","hooks_url":"https://api.github.com/repos/gtank/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/gtank/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/gtank/kubernetes/events","assignees_url":"https://api.github.com/repos/gtank/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/gtank/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/gtank/kubernetes/tags","blobs_url":"https://api.github.com/repos/gtank/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gtank/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gtank/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/gtank/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gtank/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/gtank/kubernetes/languages","stargazers_url":"https://api.github.com/repos/gtank/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/gtank/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/gtank/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/gtank/kubernetes/subscription","commits_url":"https://api.github.com/repos/gtank/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/gtank/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/gtank/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/gtank/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/gtank/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/gtank/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gtank/kubernetes/merges","archive_url":"https://api.github.com/repos/gtank/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gtank/kubernetes/downloads","issues_url":"https://api.github.com/repos/gtank/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/gtank/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/gtank/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/gtank/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gtank/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/gtank/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/gtank/kubernetes/deployments","created_at":"2016-02-01T21:36:29Z","updated_at":"2016-02-01T21:36:41Z","pushed_at":"2016-03-01T22:32:10Z","git_url":"git://github.com/gtank/kubernetes.git","ssh_url":"git@github.com:gtank/kubernetes.git","clone_url":"https://github.com/gtank/kubernetes.git","svn_url":"https://github.com/gtank/kubernetes","homepage":"http://kubernetes.io","size":171570,"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":"7e158006c06fd432b3461f83026b85a72721eddc","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":"Container Cluster Manager from Google","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-03-02T20:23:46Z","pushed_at":"2016-03-02T19:57:23Z","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":333632,"stargazers_count":13002,"watchers_count":13002,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3727,"mirror_url":null,"open_issues_count":2987,"forks":3727,"open_issues":2987,"watchers":13002,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/20439"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/20439"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/20439/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/20439/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/c553c5b575bc4d3d33f6b37cce41af613a55af86"}}}}