kubernetes/pkg/kubectl/cmd
k8s-merge-robot 2c471bce4e Merge pull request #25509 from janetkuo/kubectl-set-image
Automatic merge from submit-queue

Add 'kubectl set image'

```release-note
Add "kubectl set image" for easier updating container images (for pods or resources with pod templates). 
```

**Usage:**
```
kubectl set image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N
```
**Example:**
```console 
# Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'.
$ kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1

# Update all deployments' nginx container's image to 'nginx:1.9.1'
$ kubectl set image deployments nginx=nginx:1.9.1 --all

# Update image of all containers of daemonset abc to 'nginx:1.9.1'
$ kubectl set image daemonset abc *=nginx:1.9.1

# Print result (in yaml format) of updating nginx container image from local file, without hitting the server 
$ kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml
```

I abandoned the `--container=xxx --image=xxx` flags in the [deploy proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/deploy.md#kubectl-set) since it's much easier to use with just KEY=VALUE (CONTAINER_NAME=CONTAINER_IMAGE) pairs. 

Ref #21648 
@kubernetes/kubectl @bgrant0607 @kubernetes/sig-config 


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-20 07:13:45 -07:00
..
config Move ModifyConfig (and some related functions) into the clientcmd pkg. 2016-05-07 18:15:18 -07:00
rollout Merge pull request #25110 from metral/recursive-rollout 2016-05-15 06:14:21 -07:00
set Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
util Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
annotate_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
annotate.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
apiversions.go Move the discovery client to its own package 2016-03-04 13:44:52 -08:00
apply_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
apply.go update kubectl apply help info 2016-05-03 22:50:24 -04:00
attach_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
attach.go Refactor exec code to support version skew testing 2016-04-01 13:05:50 -04:00
autoscale.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
clusterinfo.go Fix the rest of the code 2016-04-29 17:12:10 -04:00
cmd_test.go Merge pull request #24090 from AdoHe/expose_rc 2016-05-14 07:15:58 -07:00
cmd.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
convert.go Change ConvertToVersion to use GroupVersion 2016-05-12 10:10:35 -04:00
create_configmap_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
create_configmap.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
create_namespace_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
create_namespace.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
create_secret_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
create_secret.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
create_serviceaccount_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
create_serviceaccount.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
create_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
create.go Fix the rest of the code 2016-04-29 17:12:10 -04:00
delete_test.go Allow StatusErrors to be modified after creation 2016-05-19 09:08:53 -04:00
delete.go kubectl suggest for get (list, ps), and delete(rm) 2016-05-04 17:18:52 -07:00
describe_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
describe.go Introduce kubectl describe --show-events 2016-05-06 11:40:11 +02:00
drain_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
drain.go Small refactoring around drain - move drain logic to separate function. 2016-05-04 10:43:20 +02:00
edit.go Change ConvertToVersion to use GroupVersion 2016-05-12 10:10:35 -04:00
exec_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
exec.go Refactor exec code to support version skew testing 2016-04-01 13:05:50 -04:00
explain.go Add third party support to kubectl 2016-03-31 10:53:32 -07:00
expose_test.go Merge pull request #24090 from AdoHe/expose_rc 2016-05-14 07:15:58 -07:00
expose.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
get_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
get.go Merge pull request #25181 from janetkuo/kubectl-suggest 2016-05-13 10:08:22 -07:00
label_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
label.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
logs_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
logs.go Add third party support to kubectl 2016-03-31 10:53:32 -07:00
namespace.go typofix - https://github.com/vlajos/misspell_fixer 2015-08-08 22:31:48 +01:00
patch_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
patch.go allow kubectl subcmds to process multiple resources 2016-05-01 20:27:37 -07:00
portforward_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
portforward.go Port-forward: use out and error streams instead of glog 2016-04-27 13:26:54 -04:00
proxy.go update commented examples just remove $ 2016-02-29 09:41:09 -05:00
replace_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
replace.go Add third party support to kubectl 2016-03-31 10:53:32 -07:00
rollingupdate_test.go Update rollback process 2015-10-08 10:49:09 +08:00
rollingupdate.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
run_test.go Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
run.go Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
scale.go allow kubectl subcmds to process multiple resources 2016-05-01 20:27:37 -07:00
stop.go Add third party support to kubectl 2016-03-31 10:53:32 -07:00
taint_test.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
taint.go implement taints and tolerations 2016-05-18 15:06:23 +00:00
version.go Remove shorthand for client flag in kubectl version 2015-10-13 02:02:54 +08:00