{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63214","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63214/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63214/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63214/events","html_url":"https://github.com/kubernetes/kubernetes/issues/63214","id":318176023,"node_id":"MDU6SXNzdWUzMTgxNzYwMjM=","number":63214,"title":"kubectl run from a manifest file","user":{"login":"jeremywadsack","id":241324,"node_id":"MDQ6VXNlcjI0MTMyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/241324?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremywadsack","html_url":"https://github.com/jeremywadsack","followers_url":"https://api.github.com/users/jeremywadsack/followers","following_url":"https://api.github.com/users/jeremywadsack/following{/other_user}","gists_url":"https://api.github.com/users/jeremywadsack/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremywadsack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremywadsack/subscriptions","organizations_url":"https://api.github.com/users/jeremywadsack/orgs","repos_url":"https://api.github.com/users/jeremywadsack/repos","events_url":"https://api.github.com/users/jeremywadsack/events{/privacy}","received_events_url":"https://api.github.com/users/jeremywadsack/received_events","type":"User","site_admin":false},"labels":[{"id":267761362,"node_id":"MDU6TGFiZWwyNjc3NjEzNjI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/feature","name":"kind/feature","color":"c7def8","default":false},{"id":778118404,"node_id":"MDU6TGFiZWw3NzgxMTg0MDQ=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/lifecycle/stale","name":"lifecycle/stale","color":"795548","default":false},{"id":450823910,"node_id":"MDU6TGFiZWw0NTA4MjM5MTA=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/cli","name":"sig/cli","color":"d2b48c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-26T19:59:17Z","updated_at":"2018-07-26T03:29:24Z","closed_at":null,"author_association":"NONE","body":"**Is this a BUG REPORT or FEATURE REQUEST?**:\r\n\r\n/kind feature\r\n\r\n**What happened**:\r\n\r\nAs discussed in #48684 we also have a use case where we would like to spin up a pod, run a command, and throwaway the pod. `kubectl run` seems to support this except that it gets very complicated to bring up a pod matching the environment of an existing deployment. Specifically, attaching secrets.\r\n\r\nThe commonly cited example is to spin up a pod to run database migrations during a deployment.\r\n\r\nThat PR has to do with adding an `--end-from` option to the `kubectly run` but on further discussion, the use of `--override` seems to have resolved some of the problems. However, that has it's own issues, as [@javanthropus mentioned](https://github.com/kubernetes/kubernetes/pull/48684#issuecomment-382048645):\r\n\r\n> This seems a little backwards logically though because we want the manifest to be the base definition, where the additional command line options provide overrides. It's also a mess to have to pass the entire manifest on the command line.\r\n\r\nI would like to be able to specify the image on the command-line and override the spec. Specifically, I'd like to have a static manifest to load from and then add a tag to the image from our script so I can make sure I'm using the right image.\r\n\r\nSomething like this (which currently ignores the command-line:)\r\n\r\n```\r\nkubectl run -shell --image image:${TAG:-latest} --restart=Never --overrides $overrides -- bin/rails db:migrate\r\n```\r\n\r\n> Going further, as with the create and apply commands, it would be great if the manifest could be supplied in either JSON or YAML formats.\r\n\r\nAgreed because all other configuration files are in YAML.  I ended up with this so we could store the manifest in YAML like we do everything else:\r\n\r\n```\r\n--overrides $(ruby -r json -r yaml -e 'puts JSON.dump YAML.load_file(\"shell.yml\")')\r\n```\r\n\r\nBut I ran into further issues where if `--restart=Never` is on the `run` command, it launches a Pod, but _ignores_ the command line and just runs the default command in the Docker image.\r\n\r\n**What you expected to happen**:\r\n\r\nIt would be great to have a `-f` option like `apply` does:\r\n\r\n```\r\nkubectl run -it --rm --restart=Never --filename pod.json\r\n```\r\n\r\n**Anything else we need to know?**:\r\n\r\n**Environment**:\r\n- Kubernetes version (use `kubectl version`):\r\n  ```\r\n  $ kubectl version\r\n  Client Version: version.Info{Major:\"1\", Minor:\"8\", GitVersion:\"v1.8.6\", GitCommit:\"6260bb08c46c31eea6cb538b34a9ceb3e406689c\", GitTreeState:\"clean\", BuildDate:\"2017-12-21T06:34:11Z\", GoVersion:\"go1.8.3\", Compiler:\"gc\", Platform:\"darwin/amd64\"}\r\n  Server Version: version.Info{Major:\"1\", Minor:\"9+\", GitVersion:\"v1.9.6-gke.1\", GitCommit:\"cb151369f60073317da686a6ce7de36abe2bda8d\", GitTreeState:\"clean\", BuildDate:\"2018-04-07T22:06:59Z\", GoVersion:\"go1.9.3b4\", Compiler:\"gc\", Platform:\"linux/amd64\"}\r\n  ```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/407964974","html_url":"https://github.com/kubernetes/kubernetes/issues/63214#issuecomment-407964974","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/63214","id":407964974,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzk2NDk3NA==","user":{"login":"jeremywadsack","id":241324,"node_id":"MDQ6VXNlcjI0MTMyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/241324?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremywadsack","html_url":"https://github.com/jeremywadsack","followers_url":"https://api.github.com/users/jeremywadsack/followers","following_url":"https://api.github.com/users/jeremywadsack/following{/other_user}","gists_url":"https://api.github.com/users/jeremywadsack/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremywadsack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremywadsack/subscriptions","organizations_url":"https://api.github.com/users/jeremywadsack/orgs","repos_url":"https://api.github.com/users/jeremywadsack/repos","events_url":"https://api.github.com/users/jeremywadsack/events{/privacy}","received_events_url":"https://api.github.com/users/jeremywadsack/received_events","type":"User","site_admin":false},"created_at":"2018-07-26T03:29:24Z","updated_at":"2018-07-26T03:29:24Z","author_association":"NONE","body":"/remove-lifecycle stale\r\n"}}
{"actor":{"display_login":"jeremywadsack"}}