{"action":"created","comment":{"url":"https://api.github.com/repos/k8sp/vm-cluster/pulls/comments/77567559","id":77567559,"diff_hunk":"@@ -1,43 +1,116 @@\n-# References:\n-#  1. Private network: https://github.com/k8sp/auto-install/issues/102#issuecomment-238005425\n-#  2. Install Docker: https://docs.docker.com/engine/installation/linux/ubuntulinux/\n Vagrant.configure(\"2\") do |config|\n-  \n-#   config.vm.box = \"ubuntu/trusty64\"\n-\n-#   config.vm.synced_folder \"~/work\", \"/work\"\n-\n-\n-#   # Install Docker on both VMs.\n-#   config.vm.provision \"shell\", inline: <<-SHELL\n-# apt-get update\n-# apt-get install -y apt-transport-https ca-certificates\n-# apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D\n-# touch /etc/apt/sources.list.d/docker.list\n-# chown vagrant /etc/apt/sources.list.d/docker.list\n-# echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' >> /etc/apt/sources.list.d/docker.list\n-# apt-get update\n-# apt-get install -y linux-image-extra-$(uname -r)\n-# apt-get install -y docker-engine\n-# service docker start\n-# groupadd docker\n-# usermod -aG docker vagrant\n-# echo '192.168.50.4 bootstrapper' >> /etc/hosts\n-#   SHELL\n \n+   config.vm.provision \"shell\", inline: <<-SHELL\n+     echo '192.168.8.101 bootstrapper' >> /etc/hosts\n+   SHELL\n+\n+#定义boostrapper虚拟机\n   config.vm.define \"bootstrapper\" do |bs|\n     bs.vm.box = \"coreos-stable\"\n     bs.vm.box_url = \"https://storage.googleapis.com/stable.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json\" % [$update_channel, $image_version]\n-    \n-    bs.vm.network \"private_network\", ip: \"192.168.50.4\", name: \"vboxnet0\"\n+    bs.vm.hostname = \"bootstrapper\"\n+    bs.vm.network \"private_network\", ip: \"192.168.8.101\",virtualbox__intnet: true\n+    bs.vm.provision \"shell\", inline: <<-SHELL\n+#设置ssh免密码登陆\n+rm -rf ~/.ssh/\n+/usr/bin/ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ''\n+cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys\n+\n+#设置docker registry免tls验证\n+mkdir -p /etc/systemd/system/docker.service.d/\n+cat << EOF > /etc/systemd/system/docker.service.d/50-insecure-registry.conf\n+[Service]\n+Environment=DOCKER_OPTS='--insecure-registry=\"bootstrapper:5000\"'\n+EOF\n+systemctl daemon-reload\n+systemctl start docker\n+\n+#将boostrapper 代码下载到本地\n+cd ~\n+git clone https://github.com/k8sp/auto-install.git\n+cd auto-install\n+\n+#修改cluster-desc.yml配置文件\n+mkdir -p /root/auto-install/cloud-config-server/template/unisound-ailab\n+cat << EOF > /root/auto-install/cloud-config-server/template/unisound-ailab/build_config.yml \n+bootstrapper: 192.168.8.101\n+subnet: 192.168.8.0\n+netmask: 255.255.255.0\n+iplow: 192.168.8.201\n+iphigh: 192.168.8.220\n+routers: [192.168.8.101]\n+broadcast: 192.168.8.255\n+nameservers: [192.168.8.101, 8.8.8.8, 8.8.4.4]\n+domainname: \"192.168.8.101\"\n+dockerdomain: \"bootstrapper\"\n+\n+nodes:\n+  - mac: \"08:00:27:4a:2d:a1\"\n+    ceph_monitor: n\n+    kube_master: y\n+    etcd_member: y\n+\n+ssh_authorized_keys: |1+\n+    - \"<SSH_KEY>\"\n+EOF\n+\n+\n+ssh_key=`cat ~/.ssh/authorized_keys` \n+sed -i -e 's#<SSH_KEY>#'\"$ssh_key\"'#' /root/auto-install/cloud-config-server/template/unisound-ailab/build_config.yml\n+\n+./bsroot.sh\n+\n+\n+cd /bsroot/tls\n+rm -rf *\n+openssl genrsa -out ca-key.pem 2048\n+openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj \"/CN=kube-ca\"\n+\n+#修复无法找到pxe　server的异常\n+sed -i '/interface=eth0/,/domain=k8s.baifendian.com/d' /bsroot/config/dnsmasq.conf\n+#修复docker api client 和server 版本不一致的问题\n+cd ~/auto-install\n+sed -i '/FROM golang:alpine/a\\ENV DOCKER_API_VERSION=1.22' ./Dockerfile\n+docker build -t bootstrapper .\n+docker run -d --net=host \\\n+  --privileged \\\n+  -v /var/run/docker.sock:/var/run/docker.sock \\\n+  -v /bsroot:/bsroot \\\n+  bootstrapper\n+\n+  SHELL\n+\n \n     bs.vm.provider \"virtualbox\" do |vb|\n       vb.gui = false\n       vb.memory = \"2048\"\n     end\n   end\n \n-  # config.vm.define \"node\" do |nd|\n-  #   nd.vm.network \"private_network\", ip: \"192.168.50.5\", name: \"vboxnet0\"\n-  # end\n+# 定义k8s master虚拟机\n+    config.vm.define \"master\" do |master|\n+      master.vm.box =\"c33s/empty\"\n+      master.ssh.insert_key = false\n+      master.vm.network  \"private_network\", type: \"dhcp\", virtualbox__intnet: true, :mac => \"0800274a2da1\", :adapter=>1, auto_config: false","path":"Vagrantfile","position":124,"original_position":124,"commit_id":"b0c215e31d202e6ad6ca3f194c572960b31db016","original_commit_id":"b0c215e31d202e6ad6ca3f194c572960b31db016","user":{"login":"pineking","id":72760,"avatar_url":"https://avatars.githubusercontent.com/u/72760?v=3","gravatar_id":"","url":"https://api.github.com/users/pineking","html_url":"https://github.com/pineking","followers_url":"https://api.github.com/users/pineking/followers","following_url":"https://api.github.com/users/pineking/following{/other_user}","gists_url":"https://api.github.com/users/pineking/gists{/gist_id}","starred_url":"https://api.github.com/users/pineking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pineking/subscriptions","organizations_url":"https://api.github.com/users/pineking/orgs","repos_url":"https://api.github.com/users/pineking/repos","events_url":"https://api.github.com/users/pineking/events{/privacy}","received_events_url":"https://api.github.com/users/pineking/received_events","type":"User","site_admin":false},"body":"这里为什么要指定 mac 地址？是为了上面根据 hostname 指定 host 的角色？","created_at":"2016-09-06T03:03:50Z","updated_at":"2016-09-06T03:03:50Z","html_url":"https://github.com/k8sp/vm-cluster/pull/1#discussion_r77567559","pull_request_url":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/k8sp/vm-cluster/pulls/comments/77567559"},"html":{"href":"https://github.com/k8sp/vm-cluster/pull/1#discussion_r77567559"},"pull_request":{"href":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1","id":83993888,"html_url":"https://github.com/k8sp/vm-cluster/pull/1","diff_url":"https://github.com/k8sp/vm-cluster/pull/1.diff","patch_url":"https://github.com/k8sp/vm-cluster/pull/1.patch","issue_url":"https://api.github.com/repos/k8sp/vm-cluster/issues/1","number":1,"state":"open","locked":false,"title":"vm cluster自动化安装k8s测试","user":{"login":"zhengbo0","id":14144704,"avatar_url":"https://avatars.githubusercontent.com/u/14144704?v=3","gravatar_id":"","url":"https://api.github.com/users/zhengbo0","html_url":"https://github.com/zhengbo0","followers_url":"https://api.github.com/users/zhengbo0/followers","following_url":"https://api.github.com/users/zhengbo0/following{/other_user}","gists_url":"https://api.github.com/users/zhengbo0/gists{/gist_id}","starred_url":"https://api.github.com/users/zhengbo0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhengbo0/subscriptions","organizations_url":"https://api.github.com/users/zhengbo0/orgs","repos_url":"https://api.github.com/users/zhengbo0/repos","events_url":"https://api.github.com/users/zhengbo0/events{/privacy}","received_events_url":"https://api.github.com/users/zhengbo0/received_events","type":"User","site_admin":false},"body":"vm cluster自动化安装k8s测试","created_at":"2016-09-05T12:18:49Z","updated_at":"2016-09-06T03:03:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"39531bdaee61744e8969f885a38be3d3326bf0e6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1/commits","review_comments_url":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1/comments","review_comment_url":"https://api.github.com/repos/k8sp/vm-cluster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/k8sp/vm-cluster/issues/1/comments","statuses_url":"https://api.github.com/repos/k8sp/vm-cluster/statuses/b0c215e31d202e6ad6ca3f194c572960b31db016","head":{"label":"zhengbo0:master","ref":"master","sha":"b0c215e31d202e6ad6ca3f194c572960b31db016","user":{"login":"zhengbo0","id":14144704,"avatar_url":"https://avatars.githubusercontent.com/u/14144704?v=3","gravatar_id":"","url":"https://api.github.com/users/zhengbo0","html_url":"https://github.com/zhengbo0","followers_url":"https://api.github.com/users/zhengbo0/followers","following_url":"https://api.github.com/users/zhengbo0/following{/other_user}","gists_url":"https://api.github.com/users/zhengbo0/gists{/gist_id}","starred_url":"https://api.github.com/users/zhengbo0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhengbo0/subscriptions","organizations_url":"https://api.github.com/users/zhengbo0/orgs","repos_url":"https://api.github.com/users/zhengbo0/repos","events_url":"https://api.github.com/users/zhengbo0/events{/privacy}","received_events_url":"https://api.github.com/users/zhengbo0/received_events","type":"User","site_admin":false},"repo":{"id":67409247,"name":"vm-cluster","full_name":"zhengbo0/vm-cluster","owner":{"login":"zhengbo0","id":14144704,"avatar_url":"https://avatars.githubusercontent.com/u/14144704?v=3","gravatar_id":"","url":"https://api.github.com/users/zhengbo0","html_url":"https://github.com/zhengbo0","followers_url":"https://api.github.com/users/zhengbo0/followers","following_url":"https://api.github.com/users/zhengbo0/following{/other_user}","gists_url":"https://api.github.com/users/zhengbo0/gists{/gist_id}","starred_url":"https://api.github.com/users/zhengbo0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhengbo0/subscriptions","organizations_url":"https://api.github.com/users/zhengbo0/orgs","repos_url":"https://api.github.com/users/zhengbo0/repos","events_url":"https://api.github.com/users/zhengbo0/events{/privacy}","received_events_url":"https://api.github.com/users/zhengbo0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhengbo0/vm-cluster","description":null,"fork":true,"url":"https://api.github.com/repos/zhengbo0/vm-cluster","forks_url":"https://api.github.com/repos/zhengbo0/vm-cluster/forks","keys_url":"https://api.github.com/repos/zhengbo0/vm-cluster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhengbo0/vm-cluster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhengbo0/vm-cluster/teams","hooks_url":"https://api.github.com/repos/zhengbo0/vm-cluster/hooks","issue_events_url":"https://api.github.com/repos/zhengbo0/vm-cluster/issues/events{/number}","events_url":"https://api.github.com/repos/zhengbo0/vm-cluster/events","assignees_url":"https://api.github.com/repos/zhengbo0/vm-cluster/assignees{/user}","branches_url":"https://api.github.com/repos/zhengbo0/vm-cluster/branches{/branch}","tags_url":"https://api.github.com/repos/zhengbo0/vm-cluster/tags","blobs_url":"https://api.github.com/repos/zhengbo0/vm-cluster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhengbo0/vm-cluster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhengbo0/vm-cluster/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhengbo0/vm-cluster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhengbo0/vm-cluster/statuses/{sha}","languages_url":"https://api.github.com/repos/zhengbo0/vm-cluster/languages","stargazers_url":"https://api.github.com/repos/zhengbo0/vm-cluster/stargazers","contributors_url":"https://api.github.com/repos/zhengbo0/vm-cluster/contributors","subscribers_url":"https://api.github.com/repos/zhengbo0/vm-cluster/subscribers","subscription_url":"https://api.github.com/repos/zhengbo0/vm-cluster/subscription","commits_url":"https://api.github.com/repos/zhengbo0/vm-cluster/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhengbo0/vm-cluster/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhengbo0/vm-cluster/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhengbo0/vm-cluster/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhengbo0/vm-cluster/contents/{+path}","compare_url":"https://api.github.com/repos/zhengbo0/vm-cluster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhengbo0/vm-cluster/merges","archive_url":"https://api.github.com/repos/zhengbo0/vm-cluster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhengbo0/vm-cluster/downloads","issues_url":"https://api.github.com/repos/zhengbo0/vm-cluster/issues{/number}","pulls_url":"https://api.github.com/repos/zhengbo0/vm-cluster/pulls{/number}","milestones_url":"https://api.github.com/repos/zhengbo0/vm-cluster/milestones{/number}","notifications_url":"https://api.github.com/repos/zhengbo0/vm-cluster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhengbo0/vm-cluster/labels{/name}","releases_url":"https://api.github.com/repos/zhengbo0/vm-cluster/releases{/id}","deployments_url":"https://api.github.com/repos/zhengbo0/vm-cluster/deployments","created_at":"2016-09-05T09:53:25Z","updated_at":"2016-08-27T17:16:55Z","pushed_at":"2016-09-06T02:37:28Z","git_url":"git://github.com/zhengbo0/vm-cluster.git","ssh_url":"git@github.com:zhengbo0/vm-cluster.git","clone_url":"https://github.com/zhengbo0/vm-cluster.git","svn_url":"https://github.com/zhengbo0/vm-cluster","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":null,"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":"k8sp:master","ref":"master","sha":"c6f99125065430b0f3f24289cab284ba0db7f246","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":66726333,"name":"vm-cluster","full_name":"k8sp/vm-cluster","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/vm-cluster","description":null,"fork":false,"url":"https://api.github.com/repos/k8sp/vm-cluster","forks_url":"https://api.github.com/repos/k8sp/vm-cluster/forks","keys_url":"https://api.github.com/repos/k8sp/vm-cluster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/k8sp/vm-cluster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/k8sp/vm-cluster/teams","hooks_url":"https://api.github.com/repos/k8sp/vm-cluster/hooks","issue_events_url":"https://api.github.com/repos/k8sp/vm-cluster/issues/events{/number}","events_url":"https://api.github.com/repos/k8sp/vm-cluster/events","assignees_url":"https://api.github.com/repos/k8sp/vm-cluster/assignees{/user}","branches_url":"https://api.github.com/repos/k8sp/vm-cluster/branches{/branch}","tags_url":"https://api.github.com/repos/k8sp/vm-cluster/tags","blobs_url":"https://api.github.com/repos/k8sp/vm-cluster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/k8sp/vm-cluster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/k8sp/vm-cluster/git/refs{/sha}","trees_url":"https://api.github.com/repos/k8sp/vm-cluster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/k8sp/vm-cluster/statuses/{sha}","languages_url":"https://api.github.com/repos/k8sp/vm-cluster/languages","stargazers_url":"https://api.github.com/repos/k8sp/vm-cluster/stargazers","contributors_url":"https://api.github.com/repos/k8sp/vm-cluster/contributors","subscribers_url":"https://api.github.com/repos/k8sp/vm-cluster/subscribers","subscription_url":"https://api.github.com/repos/k8sp/vm-cluster/subscription","commits_url":"https://api.github.com/repos/k8sp/vm-cluster/commits{/sha}","git_commits_url":"https://api.github.com/repos/k8sp/vm-cluster/git/commits{/sha}","comments_url":"https://api.github.com/repos/k8sp/vm-cluster/comments{/number}","issue_comment_url":"https://api.github.com/repos/k8sp/vm-cluster/issues/comments{/number}","contents_url":"https://api.github.com/repos/k8sp/vm-cluster/contents/{+path}","compare_url":"https://api.github.com/repos/k8sp/vm-cluster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/k8sp/vm-cluster/merges","archive_url":"https://api.github.com/repos/k8sp/vm-cluster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/k8sp/vm-cluster/downloads","issues_url":"https://api.github.com/repos/k8sp/vm-cluster/issues{/number}","pulls_url":"https://api.github.com/repos/k8sp/vm-cluster/pulls{/number}","milestones_url":"https://api.github.com/repos/k8sp/vm-cluster/milestones{/number}","notifications_url":"https://api.github.com/repos/k8sp/vm-cluster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/k8sp/vm-cluster/labels{/name}","releases_url":"https://api.github.com/repos/k8sp/vm-cluster/releases{/id}","deployments_url":"https://api.github.com/repos/k8sp/vm-cluster/deployments","created_at":"2016-08-27T17:16:55Z","updated_at":"2016-08-27T17:16:55Z","pushed_at":"2016-09-06T02:37:28Z","git_url":"git://github.com/k8sp/vm-cluster.git","ssh_url":"git@github.com:k8sp/vm-cluster.git","clone_url":"https://github.com/k8sp/vm-cluster.git","svn_url":"https://github.com/k8sp/vm-cluster","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1"},"html":{"href":"https://github.com/k8sp/vm-cluster/pull/1"},"issue":{"href":"https://api.github.com/repos/k8sp/vm-cluster/issues/1"},"comments":{"href":"https://api.github.com/repos/k8sp/vm-cluster/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/k8sp/vm-cluster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/k8sp/vm-cluster/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/k8sp/vm-cluster/statuses/b0c215e31d202e6ad6ca3f194c572960b31db016"}}}}
{"actor":{"display_login":"pineking"}}