{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22818","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22818/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22818/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22818/events","html_url":"https://github.com/kubernetes/kubernetes/pull/22818","id":139994735,"number":22818,"title":"Trusty: Avoid reaching GCE custom metadata size limit","user":{"login":"andyzheng0831","id":8453435,"avatar_url":"https://avatars.githubusercontent.com/u/8453435?v=3","gravatar_id":"","url":"https://api.github.com/users/andyzheng0831","html_url":"https://github.com/andyzheng0831","followers_url":"https://api.github.com/users/andyzheng0831/followers","following_url":"https://api.github.com/users/andyzheng0831/following{/other_user}","gists_url":"https://api.github.com/users/andyzheng0831/gists{/gist_id}","starred_url":"https://api.github.com/users/andyzheng0831/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andyzheng0831/subscriptions","organizations_url":"https://api.github.com/users/andyzheng0831/orgs","repos_url":"https://api.github.com/users/andyzheng0831/repos","events_url":"https://api.github.com/users/andyzheng0831/events{/privacy}","received_events_url":"https://api.github.com/users/andyzheng0831/received_events","type":"User","site_admin":false},"labels":[{"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/ok-to-merge","name":"ok-to-merge","color":"fbca04"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XXL","name":"size/XXL","color":"ee0000"}],"state":"open","locked":false,"assignee":{"login":"roberthbailey","id":7751204,"avatar_url":"https://avatars.githubusercontent.com/u/7751204?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthbailey","html_url":"https://github.com/roberthbailey","followers_url":"https://api.github.com/users/roberthbailey/followers","following_url":"https://api.github.com/users/roberthbailey/following{/other_user}","gists_url":"https://api.github.com/users/roberthbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthbailey/subscriptions","organizations_url":"https://api.github.com/users/roberthbailey/orgs","repos_url":"https://api.github.com/users/roberthbailey/repos","events_url":"https://api.github.com/users/roberthbailey/events{/privacy}","received_events_url":"https://api.github.com/users/roberthbailey/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2016-03-10T20:04:19Z","updated_at":"2016-03-12T03:51:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/22818","html_url":"https://github.com/kubernetes/kubernetes/pull/22818","diff_url":"https://github.com/kubernetes/kubernetes/pull/22818.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/22818.patch"},"body":"GCE custom metadata has a size limit of 32 KB. The file cluster/gce/trusty/configure.sh is uploaded as GCE custom metadata, but its size is already very close to the limit. Recently I tried to add code in the file to support a new feature, but cluster creation failed due to exceeding metadata size. So, it is the time to fix this problem.\r\n\r\nBasically, most of this PR is code refactoring:\r\n(1) I split the origin configure.sh into two file. The functions for installing k8s binary and configurations files are left in configure.sh, which will be uploaded as GCE metadata as before. I try to avoid changing instance metadata keys. All other functions are moved to configure-helper.sh, and this file is packed in kube-manifest.tar.gz. In future development, most likely we only need to change configure-helper.sh.\r\n\r\n(2) Small changes in instance initialization sequence. Originally, we first prepare environment and then download k8s binary/configuration files. With this change, downloading becomes the first step, because we need to source configure-helper.sh for most remaining steps, which is packed in kube-manifest tarball.\r\n\r\nI have run e2e tests on Trusty and no breakage caused by this PR."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/195652808","html_url":"https://github.com/kubernetes/kubernetes/pull/22818#issuecomment-195652808","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/22818","id":195652808,"user":{"login":"roberthbailey","id":7751204,"avatar_url":"https://avatars.githubusercontent.com/u/7751204?v=3","gravatar_id":"","url":"https://api.github.com/users/roberthbailey","html_url":"https://github.com/roberthbailey","followers_url":"https://api.github.com/users/roberthbailey/followers","following_url":"https://api.github.com/users/roberthbailey/following{/other_user}","gists_url":"https://api.github.com/users/roberthbailey/gists{/gist_id}","starred_url":"https://api.github.com/users/roberthbailey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roberthbailey/subscriptions","organizations_url":"https://api.github.com/users/roberthbailey/orgs","repos_url":"https://api.github.com/users/roberthbailey/repos","events_url":"https://api.github.com/users/roberthbailey/events{/privacy}","received_events_url":"https://api.github.com/users/roberthbailey/received_events","type":"User","site_admin":false},"created_at":"2016-03-12T03:51:07Z","updated_at":"2016-03-12T03:51:07Z","body":"@cjcullen and I were chatting about exceeding metadata size limits with startup scripts today and he found that by stripping comments we cut down the number of bytes by 25%. Have you considered stripping comments before sticking the script into metadata? We could also consider applying more aggressive minification to the scripts."}}