{"action":"created","comment":{"url":"https://api.github.com/repos/k8sp/auto-install/pulls/comments/70915252","id":70915252,"diff_hunk":"@@ -0,0 +1,74 @@\n+# Cloud-Config Template Server （CCTS）\n+\n+我们的[自动安装CoreOS](https://github.com/k8sp/bare-metal-coreos)和\n+[自动部署Kubernetes](https://github.com/k8sp/k8s-coreos-bare-metal)的\n+过程需要为机群中每一台机器提供一个 cloud-config 文件。这些机器的\n+cloud-config 文件大同小异，所以适合写一个 template，然后带入和每台机器\n+（以及机群）相关的具体信息。cloud-config template server （CCTS） 是一\n+个 HTTP server，就是负责 template execution，并且为安装过程提供\n+cloud-config 文件的。\n+\n+## 配置信息的更新\n+\n+为了方便合作编辑，我们选择用Github来维护cloud-config模板文件\n+`cloud-config.template` 和配置信息文件 `build-config.yml` 。 通常我们\n+会把这两个文件放在一个私有 Github repo里，这样可以通过输入用户名和密码\n+访问，或者通过绑定一个 private SSH key 来访问。\n+\n+当CoreOS安装脚本向 CCTS 请求一个特定mac地址的机器的 cloud-config 文件\n+的时候，CCTS 访问 Github 获取模板和配置信息，并且执行 template\n+execution 把配置信息带入模板， 和返回cloud-config。\n+\n+具体地说，每当我们将一台新的（没有操作系统的）机器加入到机群里并且接通\n+电源启动机器，这台机器就会通过预先配置好的PXE server引导 CoreOS 来执行\n+CoreOS/Kubernetes 安装脚本。此时安装脚本向 CCTS 请求 cloud-config。此\n+时 CCTS 会按照新机器的mac的地址寻找其配置信息，带入模板，生成和返回\n+cloud-config。\n+\n+也就是说，新机器启动后安装CoreOS 和 Kubernetes 的时候，会使用最新的模\n+板和配置信息。**而配置信息更新之后，只有重装服务器的操作系统时，才会更\n+新服务器上的 cloud-config**。\n+\n+## 配置信息的缓存\n+\n+上述过程中有一个潜在问题：如果往机群里加入新机器的时候，恰好不能访问\n+Github，就没法返回合理的 cloud-config 了。为此我们要在设立一个缓存，\n+CCTS 每隔一段时间试着访问 Github 看是否有更新，如果有，则下载下来并且\n+替换缓存中的内容。\n+\n+最简答的缓存机制是 CCTS 在内存中维护，但是如果CCTS 被重启，则缓存信息\n+就丢失了。一种更合理的方式是缓存在 etcd 里。鉴于我们安装和配置\n+CoreOS/Kubernetes 机群之前需要先有一个 etcd 机群作为 discovery service\n+来启动（bootstrap）Kubernetes机群里的etcd机群，我们可以利用这个\n+bootstrapping etcd机群来缓存模板和配置信息。\n+","path":"cloud-config-server/README.md","position":41,"original_position":44,"commit_id":"4865fbabbd8935e5edf4b7788af19da9a22d8ad7","original_commit_id":"3c37cee878b42ff827dfb7521d05c7659d019bcf","user":{"login":"jiamliang","id":1405049,"avatar_url":"https://avatars.githubusercontent.com/u/1405049?v=3","gravatar_id":"","url":"https://api.github.com/users/jiamliang","html_url":"https://github.com/jiamliang","followers_url":"https://api.github.com/users/jiamliang/followers","following_url":"https://api.github.com/users/jiamliang/following{/other_user}","gists_url":"https://api.github.com/users/jiamliang/gists{/gist_id}","starred_url":"https://api.github.com/users/jiamliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiamliang/subscriptions","organizations_url":"https://api.github.com/users/jiamliang/orgs","repos_url":"https://api.github.com/users/jiamliang/repos","events_url":"https://api.github.com/users/jiamliang/events{/privacy}","received_events_url":"https://api.github.com/users/jiamliang/received_events","type":"User","site_admin":false},"body":"稍后修改","created_at":"2016-07-15T02:52:49Z","updated_at":"2016-07-15T02:52:49Z","html_url":"https://github.com/k8sp/auto-install/pull/3#discussion_r70915252","pull_request_url":"https://api.github.com/repos/k8sp/auto-install/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/k8sp/auto-install/pulls/comments/70915252"},"html":{"href":"https://github.com/k8sp/auto-install/pull/3#discussion_r70915252"},"pull_request":{"href":"https://api.github.com/repos/k8sp/auto-install/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/k8sp/auto-install/pulls/3","id":77400772,"html_url":"https://github.com/k8sp/auto-install/pull/3","diff_url":"https://github.com/k8sp/auto-install/pull/3.diff","patch_url":"https://github.com/k8sp/auto-install/pull/3.patch","issue_url":"https://api.github.com/repos/k8sp/auto-install/issues/3","number":3,"state":"open","locked":false,"title":"Liangjiameng","user":{"login":"jiamliang","id":1405049,"avatar_url":"https://avatars.githubusercontent.com/u/1405049?v=3","gravatar_id":"","url":"https://api.github.com/users/jiamliang","html_url":"https://github.com/jiamliang","followers_url":"https://api.github.com/users/jiamliang/followers","following_url":"https://api.github.com/users/jiamliang/following{/other_user}","gists_url":"https://api.github.com/users/jiamliang/gists{/gist_id}","starred_url":"https://api.github.com/users/jiamliang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiamliang/subscriptions","organizations_url":"https://api.github.com/users/jiamliang/orgs","repos_url":"https://api.github.com/users/jiamliang/repos","events_url":"https://api.github.com/users/jiamliang/events{/privacy}","received_events_url":"https://api.github.com/users/jiamliang/received_events","type":"User","site_admin":false},"body":"http服务目前已经可用：\r\nhttp://10.10.10.192:8080/cloud-config/00:25:90:c0:f6:d6\r\n新的问题：怎么让http服务更健壮？","created_at":"2016-07-14T05:13:54Z","updated_at":"2016-07-15T02:52:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0fff9c2f508228994c32dd62d4767e15e4019dd","assignee":{"login":"wangkuiyi","id":1548775,"avatar_url":"https://avatars.githubusercontent.com/u/1548775?v=3","gravatar_id":"","url":"https://api.github.com/users/wangkuiyi","html_url":"https://github.com/wangkuiyi","followers_url":"https://api.github.com/users/wangkuiyi/followers","following_url":"https://api.github.com/users/wangkuiyi/following{/other_user}","gists_url":"https://api.github.com/users/wangkuiyi/gists{/gist_id}","starred_url":"https://api.github.com/users/wangkuiyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangkuiyi/subscriptions","organizations_url":"https://api.github.com/users/wangkuiyi/orgs","repos_url":"https://api.github.com/users/wangkuiyi/repos","events_url":"https://api.github.com/users/wangkuiyi/events{/privacy}","received_events_url":"https://api.github.com/users/wangkuiyi/received_events","type":"User","site_admin":false},"assignees":[{"login":"wangkuiyi","id":1548775,"avatar_url":"https://avatars.githubusercontent.com/u/1548775?v=3","gravatar_id":"","url":"https://api.github.com/users/wangkuiyi","html_url":"https://github.com/wangkuiyi","followers_url":"https://api.github.com/users/wangkuiyi/followers","following_url":"https://api.github.com/users/wangkuiyi/following{/other_user}","gists_url":"https://api.github.com/users/wangkuiyi/gists{/gist_id}","starred_url":"https://api.github.com/users/wangkuiyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wangkuiyi/subscriptions","organizations_url":"https://api.github.com/users/wangkuiyi/orgs","repos_url":"https://api.github.com/users/wangkuiyi/repos","events_url":"https://api.github.com/users/wangkuiyi/events{/privacy}","received_events_url":"https://api.github.com/users/wangkuiyi/received_events","type":"User","site_admin":false},{"login":"vienlee","id":5361950,"avatar_url":"https://avatars.githubusercontent.com/u/5361950?v=3","gravatar_id":"","url":"https://api.github.com/users/vienlee","html_url":"https://github.com/vienlee","followers_url":"https://api.github.com/users/vienlee/followers","following_url":"https://api.github.com/users/vienlee/following{/other_user}","gists_url":"https://api.github.com/users/vienlee/gists{/gist_id}","starred_url":"https://api.github.com/users/vienlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vienlee/subscriptions","organizations_url":"https://api.github.com/users/vienlee/orgs","repos_url":"https://api.github.com/users/vienlee/repos","events_url":"https://api.github.com/users/vienlee/events{/privacy}","received_events_url":"https://api.github.com/users/vienlee/received_events","type":"User","site_admin":false},{"login":"lipeng-unisound","id":17057205,"avatar_url":"https://avatars.githubusercontent.com/u/17057205?v=3","gravatar_id":"","url":"https://api.github.com/users/lipeng-unisound","html_url":"https://github.com/lipeng-unisound","followers_url":"https://api.github.com/users/lipeng-unisound/followers","following_url":"https://api.github.com/users/lipeng-unisound/following{/other_user}","gists_url":"https://api.github.com/users/lipeng-unisound/gists{/gist_id}","starred_url":"https://api.github.com/users/lipeng-unisound/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lipeng-unisound/subscriptions","organizations_url":"https://api.github.com/users/lipeng-unisound/orgs","repos_url":"https://api.github.com/users/lipeng-unisound/repos","events_url":"https://api.github.com/users/lipeng-unisound/events{/privacy}","received_events_url":"https://api.github.com/users/lipeng-unisound/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/k8sp/auto-install/pulls/3/commits","review_comments_url":"https://api.github.com/repos/k8sp/auto-install/pulls/3/comments","review_comment_url":"https://api.github.com/repos/k8sp/auto-install/pulls/comments{/number}","comments_url":"https://api.github.com/repos/k8sp/auto-install/issues/3/comments","statuses_url":"https://api.github.com/repos/k8sp/auto-install/statuses/4865fbabbd8935e5edf4b7788af19da9a22d8ad7","head":{"label":"k8sp:liangjiameng","ref":"liangjiameng","sha":"4865fbabbd8935e5edf4b7788af19da9a22d8ad7","user":{"login":"k8sp","id":19252557,"avatar_url":"https://avatars.githubusercontent.com/u/19252557?v=3","gravatar_id":"","url":"https://api.github.com/users/k8sp","html_url":"https://github.com/k8sp","followers_url":"https://api.github.com/users/k8sp/followers","following_url":"https://api.github.com/users/k8sp/following{/other_user}","gists_url":"https://api.github.com/users/k8sp/gists{/gist_id}","starred_url":"https://api.github.com/users/k8sp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8sp/subscriptions","organizations_url":"https://api.github.com/users/k8sp/orgs","repos_url":"https://api.github.com/users/k8sp/repos","events_url":"https://api.github.com/users/k8sp/events{/privacy}","received_events_url":"https://api.github.com/users/k8sp/received_events","type":"Organization","site_admin":false},"repo":{"id":63209168,"name":"auto-install","full_name":"k8sp/auto-install","owner":{"login":"k8sp","id":19252557,"avatar_url":"https://avatars.githubusercontent.com/u/19252557?v=3","gravatar_id":"","url":"https://api.github.com/users/k8sp","html_url":"https://github.com/k8sp","followers_url":"https://api.github.com/users/k8sp/followers","following_url":"https://api.github.com/users/k8sp/following{/other_user}","gists_url":"https://api.github.com/users/k8sp/gists{/gist_id}","starred_url":"https://api.github.com/users/k8sp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8sp/subscriptions","organizations_url":"https://api.github.com/users/k8sp/orgs","repos_url":"https://api.github.com/users/k8sp/repos","events_url":"https://api.github.com/users/k8sp/events{/privacy}","received_events_url":"https://api.github.com/users/k8sp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/k8sp/auto-install","description":null,"fork":false,"url":"https://api.github.com/repos/k8sp/auto-install","forks_url":"https://api.github.com/repos/k8sp/auto-install/forks","keys_url":"https://api.github.com/repos/k8sp/auto-install/keys{/key_id}","collaborators_url":"https://api.github.com/repos/k8sp/auto-install/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/k8sp/auto-install/teams","hooks_url":"https://api.github.com/repos/k8sp/auto-install/hooks","issue_events_url":"https://api.github.com/repos/k8sp/auto-install/issues/events{/number}","events_url":"https://api.github.com/repos/k8sp/auto-install/events","assignees_url":"https://api.github.com/repos/k8sp/auto-install/assignees{/user}","branches_url":"https://api.github.com/repos/k8sp/auto-install/branches{/branch}","tags_url":"https://api.github.com/repos/k8sp/auto-install/tags","blobs_url":"https://api.github.com/repos/k8sp/auto-install/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/k8sp/auto-install/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/k8sp/auto-install/git/refs{/sha}","trees_url":"https://api.github.com/repos/k8sp/auto-install/git/trees{/sha}","statuses_url":"https://api.github.com/repos/k8sp/auto-install/statuses/{sha}","languages_url":"https://api.github.com/repos/k8sp/auto-install/languages","stargazers_url":"https://api.github.com/repos/k8sp/auto-install/stargazers","contributors_url":"https://api.github.com/repos/k8sp/auto-install/contributors","subscribers_url":"https://api.github.com/repos/k8sp/auto-install/subscribers","subscription_url":"https://api.github.com/repos/k8sp/auto-install/subscription","commits_url":"https://api.github.com/repos/k8sp/auto-install/commits{/sha}","git_commits_url":"https://api.github.com/repos/k8sp/auto-install/git/commits{/sha}","comments_url":"https://api.github.com/repos/k8sp/auto-install/comments{/number}","issue_comment_url":"https://api.github.com/repos/k8sp/auto-install/issues/comments{/number}","contents_url":"https://api.github.com/repos/k8sp/auto-install/contents/{+path}","compare_url":"https://api.github.com/repos/k8sp/auto-install/compare/{base}...{head}","merges_url":"https://api.github.com/repos/k8sp/auto-install/merges","archive_url":"https://api.github.com/repos/k8sp/auto-install/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/k8sp/auto-install/downloads","issues_url":"https://api.github.com/repos/k8sp/auto-install/issues{/number}","pulls_url":"https://api.github.com/repos/k8sp/auto-install/pulls{/number}","milestones_url":"https://api.github.com/repos/k8sp/auto-install/milestones{/number}","notifications_url":"https://api.github.com/repos/k8sp/auto-install/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/k8sp/auto-install/labels{/name}","releases_url":"https://api.github.com/repos/k8sp/auto-install/releases{/id}","deployments_url":"https://api.github.com/repos/k8sp/auto-install/deployments","created_at":"2016-07-13T02:54:51Z","updated_at":"2016-07-13T02:54:51Z","pushed_at":"2016-07-15T02:03:09Z","git_url":"git://github.com/k8sp/auto-install.git","ssh_url":"git@github.com:k8sp/auto-install.git","clone_url":"https://github.com/k8sp/auto-install.git","svn_url":"https://github.com/k8sp/auto-install","homepage":null,"size":13891,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"k8sp:master","ref":"master","sha":"8d0f4ca5fe7cf73354574e95f3253fd9800bf141","user":{"login":"k8sp","id":19252557,"avatar_url":"https://avatars.githubusercontent.com/u/19252557?v=3","gravatar_id":"","url":"https://api.github.com/users/k8sp","html_url":"https://github.com/k8sp","followers_url":"https://api.github.com/users/k8sp/followers","following_url":"https://api.github.com/users/k8sp/following{/other_user}","gists_url":"https://api.github.com/users/k8sp/gists{/gist_id}","starred_url":"https://api.github.com/users/k8sp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8sp/subscriptions","organizations_url":"https://api.github.com/users/k8sp/orgs","repos_url":"https://api.github.com/users/k8sp/repos","events_url":"https://api.github.com/users/k8sp/events{/privacy}","received_events_url":"https://api.github.com/users/k8sp/received_events","type":"Organization","site_admin":false},"repo":{"id":63209168,"name":"auto-install","full_name":"k8sp/auto-install","owner":{"login":"k8sp","id":19252557,"avatar_url":"https://avatars.githubusercontent.com/u/19252557?v=3","gravatar_id":"","url":"https://api.github.com/users/k8sp","html_url":"https://github.com/k8sp","followers_url":"https://api.github.com/users/k8sp/followers","following_url":"https://api.github.com/users/k8sp/following{/other_user}","gists_url":"https://api.github.com/users/k8sp/gists{/gist_id}","starred_url":"https://api.github.com/users/k8sp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8sp/subscriptions","organizations_url":"https://api.github.com/users/k8sp/orgs","repos_url":"https://api.github.com/users/k8sp/repos","events_url":"https://api.github.com/users/k8sp/events{/privacy}","received_events_url":"https://api.github.com/users/k8sp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/k8sp/auto-install","description":null,"fork":false,"url":"https://api.github.com/repos/k8sp/auto-install","forks_url":"https://api.github.com/repos/k8sp/auto-install/forks","keys_url":"https://api.github.com/repos/k8sp/auto-install/keys{/key_id}","collaborators_url":"https://api.github.com/repos/k8sp/auto-install/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/k8sp/auto-install/teams","hooks_url":"https://api.github.com/repos/k8sp/auto-install/hooks","issue_events_url":"https://api.github.com/repos/k8sp/auto-install/issues/events{/number}","events_url":"https://api.github.com/repos/k8sp/auto-install/events","assignees_url":"https://api.github.com/repos/k8sp/auto-install/assignees{/user}","branches_url":"https://api.github.com/repos/k8sp/auto-install/branches{/branch}","tags_url":"https://api.github.com/repos/k8sp/auto-install/tags","blobs_url":"https://api.github.com/repos/k8sp/auto-install/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/k8sp/auto-install/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/k8sp/auto-install/git/refs{/sha}","trees_url":"https://api.github.com/repos/k8sp/auto-install/git/trees{/sha}","statuses_url":"https://api.github.com/repos/k8sp/auto-install/statuses/{sha}","languages_url":"https://api.github.com/repos/k8sp/auto-install/languages","stargazers_url":"https://api.github.com/repos/k8sp/auto-install/stargazers","contributors_url":"https://api.github.com/repos/k8sp/auto-install/contributors","subscribers_url":"https://api.github.com/repos/k8sp/auto-install/subscribers","subscription_url":"https://api.github.com/repos/k8sp/auto-install/subscription","commits_url":"https://api.github.com/repos/k8sp/auto-install/commits{/sha}","git_commits_url":"https://api.github.com/repos/k8sp/auto-install/git/commits{/sha}","comments_url":"https://api.github.com/repos/k8sp/auto-install/comments{/number}","issue_comment_url":"https://api.github.com/repos/k8sp/auto-install/issues/comments{/number}","contents_url":"https://api.github.com/repos/k8sp/auto-install/contents/{+path}","compare_url":"https://api.github.com/repos/k8sp/auto-install/compare/{base}...{head}","merges_url":"https://api.github.com/repos/k8sp/auto-install/merges","archive_url":"https://api.github.com/repos/k8sp/auto-install/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/k8sp/auto-install/downloads","issues_url":"https://api.github.com/repos/k8sp/auto-install/issues{/number}","pulls_url":"https://api.github.com/repos/k8sp/auto-install/pulls{/number}","milestones_url":"https://api.github.com/repos/k8sp/auto-install/milestones{/number}","notifications_url":"https://api.github.com/repos/k8sp/auto-install/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/k8sp/auto-install/labels{/name}","releases_url":"https://api.github.com/repos/k8sp/auto-install/releases{/id}","deployments_url":"https://api.github.com/repos/k8sp/auto-install/deployments","created_at":"2016-07-13T02:54:51Z","updated_at":"2016-07-13T02:54:51Z","pushed_at":"2016-07-15T02:03:09Z","git_url":"git://github.com/k8sp/auto-install.git","ssh_url":"git@github.com:k8sp/auto-install.git","clone_url":"https://github.com/k8sp/auto-install.git","svn_url":"https://github.com/k8sp/auto-install","homepage":null,"size":13891,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/k8sp/auto-install/pulls/3"},"html":{"href":"https://github.com/k8sp/auto-install/pull/3"},"issue":{"href":"https://api.github.com/repos/k8sp/auto-install/issues/3"},"comments":{"href":"https://api.github.com/repos/k8sp/auto-install/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/k8sp/auto-install/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/k8sp/auto-install/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/k8sp/auto-install/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/k8sp/auto-install/statuses/4865fbabbd8935e5edf4b7788af19da9a22d8ad7"}}}}
{"actor":{"display_login":"jiamliang"}}