{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14918","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14918/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14918/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14918/events","html_url":"https://github.com/kubernetes/kubernetes/pull/14918","id":109341335,"number":14918,"title":"Add a custom generator that uses template files","user":{"login":"brendandburns","id":5751682,"avatar_url":"https://avatars.githubusercontent.com/u/5751682?v=3","gravatar_id":"","url":"https://api.github.com/users/brendandburns","html_url":"https://github.com/brendandburns","followers_url":"https://api.github.com/users/brendandburns/followers","following_url":"https://api.github.com/users/brendandburns/following{/other_user}","gists_url":"https://api.github.com/users/brendandburns/gists{/gist_id}","starred_url":"https://api.github.com/users/brendandburns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendandburns/subscriptions","organizations_url":"https://api.github.com/users/brendandburns/orgs","repos_url":"https://api.github.com/users/brendandburns/repos","events_url":"https://api.github.com/users/brendandburns/events{/privacy}","received_events_url":"https://api.github.com/users/brendandburns/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/component/kubectl","name":"component/kubectl","color":"0052cc"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/L","name":"size/L","color":"ee9900"}],"state":"open","locked":false,"assignee":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"milestone":null,"comments":62,"created_at":"2015-10-01T16:59:34Z","updated_at":"2015-12-04T08:00:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14918","html_url":"https://github.com/kubernetes/kubernetes/pull/14918","diff_url":"https://github.com/kubernetes/kubernetes/pull/14918.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/14918.patch"},"body":"@bgrant0607 @mikedanese @smarterclayton @deads2k @ghodss \r\n\r\nRef: https://github.com/kubernetes/kubernetes/issues/10527\r\nRef: https://github.com/kubernetes/kubernetes/issues/14039\r\nRef: https://github.com/kubernetes/kubernetes/issues/11492\r\n\r\nAlso facilitates https://github.com/kubernetes/kubernetes/issues/2837\r\n\r\nThis enables you to write a `Generator` which is defined by an external`template.yaml` file like:\r\n\r\n```yaml\r\napiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  name: {{ name }}\r\n  labels:\r\n    name: {{name }}\r\nspec:\r\n  containers:\r\n  - name: {{ name }}\r\n    image: {{ image }}\r\n    ports:\r\n    - containerPort: {{ port }}\r\n```\r\n\r\nYou then parameterize this generator for `kubectl run` as follows:\r\n\r\n```console\r\nkubectl run --generator=template.yaml --name=foo --image=nginx --port=8080\r\n```\r\n\r\nto get:\r\n\r\n```yaml\r\napiVersion: v1\r\nkind: Pod\r\nmetadata:\r\n  name: foo\r\n  labels:\r\n    name: foo\r\nspec:\r\n  containers:\r\n  - name: foo\r\n    image: nginx\r\n    ports:\r\n    - containerPort: 8080\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/161903565","html_url":"https://github.com/kubernetes/kubernetes/pull/14918#issuecomment-161903565","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14918","id":161903565,"user":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T08:00:22Z","updated_at":"2015-12-04T08:00:22Z","body":"Note that elsewhere in the API, we've settled on `$()` substitution syntax."}}