Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'kubectl set image' #25509

Merged
merged 1 commit into from
May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .generated_docs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ docs/man/man1/kubectl-rollout-undo.1
docs/man/man1/kubectl-rollout.1
docs/man/man1/kubectl-run.1
docs/man/man1/kubectl-scale.1
docs/man/man1/kubectl-set-image.1
docs/man/man1/kubectl-set.1
docs/man/man1/kubectl-stop.1
docs/man/man1/kubectl-taint.1
Expand Down Expand Up @@ -109,6 +110,7 @@ docs/user-guide/kubectl/kubectl_rollout_undo.md
docs/user-guide/kubectl/kubectl_run.md
docs/user-guide/kubectl/kubectl_scale.md
docs/user-guide/kubectl/kubectl_set.md
docs/user-guide/kubectl/kubectl_set_image.md
docs/user-guide/kubectl/kubectl_taint.md
docs/user-guide/kubectl/kubectl_uncordon.md
docs/user-guide/kubectl/kubectl_version.md
Expand Down
68 changes: 68 additions & 0 deletions contrib/completions/bash/kubectl
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,78 @@ _kubectl_get()
noun_aliases+=("thirdpartyresources")
}

_kubectl_set_image()
{
last_command="kubectl_set_image"
commands=()

flags=()
two_word_flags=()
flags_with_completion=()
flags_completion=()

flags+=("--all")
flags+=("--filename=")
flags_with_completion+=("--filename")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
two_word_flags+=("-f")
flags_with_completion+=("-f")
flags_completion+=("__handle_filename_extension_flag json|yaml|yml")
flags+=("--local")
flags+=("--no-headers")
flags+=("--output=")
two_word_flags+=("-o")
flags+=("--output-version=")
flags+=("--record")
flags+=("--recursive")
flags+=("-R")
flags+=("--selector=")
two_word_flags+=("-l")
flags+=("--show-all")
flags+=("-a")
flags+=("--show-labels")
flags+=("--sort-by=")
flags+=("--template=")
flags_with_completion+=("--template")
flags_completion+=("_filedir")
flags+=("--alsologtostderr")
flags+=("--api-version=")
flags+=("--as=")
flags+=("--certificate-authority=")
flags+=("--client-certificate=")
flags+=("--client-key=")
flags+=("--cluster=")
flags+=("--context=")
flags+=("--insecure-skip-tls-verify")
flags+=("--kubeconfig=")
flags+=("--log-backtrace-at=")
flags+=("--log-dir=")
flags+=("--log-flush-frequency=")
flags+=("--logtostderr")
flags+=("--match-server-version")
flags+=("--namespace=")
flags_with_completion+=("--namespace")
flags_completion+=("__kubectl_get_namespaces")
flags+=("--password=")
flags+=("--server=")
two_word_flags+=("-s")
flags+=("--stderrthreshold=")
flags+=("--token=")
flags+=("--user=")
flags+=("--username=")
flags+=("--v=")
flags+=("--vmodule=")

must_have_one_flag=()
must_have_one_noun=()
noun_aliases=()
}

_kubectl_set()
{
last_command="kubectl_set"
commands=()
commands+=("image")

flags=()
two_word_flags=()
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-autoscale.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ An autoscaler can automatically increase or decrease number of pods deployed wit

.PP
\fB\-\-dry\-run\fP=false
If true, only print the object that would be sent, without creating it.
If true, only print the object that would be sent, without sending it.

.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-expose.1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Possible resources include (case insensitive):

.PP
\fB\-\-dry\-run\fP=false
If true, only print the object that would be sent, without creating it.
If true, only print the object that would be sent, without sending it.

.PP
\fB\-\-external\-ip\fP=""
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-rolling-update.1
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ existing replication controller and overwrite at least one (common) label in its

.PP
\fB\-\-dry\-run\fP=false
If true, print out the changes that would be made, but don't actually make them.
If true, only print the object that would be sent, without sending it.

.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Expand Down
206 changes: 206 additions & 0 deletions docs/man/man1/kubectl-set-image.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" ""


.SH NAME
.PP
kubectl set image \- Update image of a pod template


.SH SYNOPSIS
.PP
\fBkubectl set image\fP [OPTIONS]


.SH DESCRIPTION
.PP
Update existing container image(s) of resources.

.PP
Possible resources include (case insensitive):
pod (po), replicationcontroller (rc), deployment, daemonset (ds), job, replicaset (rs)


.SH OPTIONS
.PP
\fB\-\-all\fP=false
select all resources in the namespace of the specified resource types

.PP
\fB\-f\fP, \fB\-\-filename\fP=[]
Filename, directory, or URL to a file identifying the resource to get from a server.

.PP
\fB\-\-local\fP=false
If true, set image will NOT contact api\-server but run locally.

.PP
\fB\-\-no\-headers\fP=false
When using the default output, don't print headers.

.PP
\fB\-o\fP, \fB\-\-output\fP=""
Output format. One of: json|yaml|wide|name|go\-template=...|go\-template\-file=...|jsonpath=...|jsonpath\-file=... See golang template [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] and jsonpath template [
\[la]http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md\[ra]].

.PP
\fB\-\-output\-version\fP=""
Output the formatted object with the given group version (for ex: 'extensions/v1beta1').

.PP
\fB\-\-record\fP=false
Record current kubectl command in the resource annotation.

.PP
\fB\-R\fP, \fB\-\-recursive\fP=false
If true, process directory recursively.

.PP
\fB\-l\fP, \fB\-\-selector\fP=""
Selector (label query) to filter on

.PP
\fB\-a\fP, \fB\-\-show\-all\fP=false
When printing, show all resources (default hide terminated pods.)

.PP
\fB\-\-show\-labels\fP=false
When printing, show all labels as the last column (default hide labels column)

.PP
\fB\-\-sort\-by\fP=""
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string.

.PP
\fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].


.SH OPTIONS INHERITED FROM PARENT COMMANDS
.PP
\fB\-\-alsologtostderr\fP=false
log to standard error as well as files

.PP
\fB\-\-api\-version\fP=""
DEPRECATED: The API version to use when talking to the server

.PP
\fB\-\-as\fP=""
Username to impersonate for the operation.

.PP
\fB\-\-certificate\-authority\fP=""
Path to a cert. file for the certificate authority.

.PP
\fB\-\-client\-certificate\fP=""
Path to a client certificate file for TLS.

.PP
\fB\-\-client\-key\fP=""
Path to a client key file for TLS.

.PP
\fB\-\-cluster\fP=""
The name of the kubeconfig cluster to use

.PP
\fB\-\-context\fP=""
The name of the kubeconfig context to use

.PP
\fB\-\-insecure\-skip\-tls\-verify\fP=false
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.

.PP
\fB\-\-kubeconfig\fP=""
Path to the kubeconfig file to use for CLI requests.

.PP
\fB\-\-log\-backtrace\-at\fP=:0
when logging hits line file:N, emit a stack trace

.PP
\fB\-\-log\-dir\fP=""
If non\-empty, write log files in this directory

.PP
\fB\-\-log\-flush\-frequency\fP=5s
Maximum number of seconds between log flushes

.PP
\fB\-\-logtostderr\fP=true
log to standard error instead of files

.PP
\fB\-\-match\-server\-version\fP=false
Require server version to match client version

.PP
\fB\-\-namespace\fP=""
If present, the namespace scope for this CLI request.

.PP
\fB\-\-password\fP=""
Password for basic authentication to the API server.

.PP
\fB\-s\fP, \fB\-\-server\fP=""
The address and port of the Kubernetes API server

.PP
\fB\-\-stderrthreshold\fP=2
logs at or above this threshold go to stderr

.PP
\fB\-\-token\fP=""
Bearer token for authentication to the API server.

.PP
\fB\-\-user\fP=""
The name of the kubeconfig user to use

.PP
\fB\-\-username\fP=""
Username for basic authentication to the API server.

.PP
\fB\-\-v\fP=0
log level for V logs

.PP
\fB\-\-vmodule\fP=
comma\-separated list of pattern=N settings for file\-filtered logging


.SH EXAMPLE
.PP
.RS

.nf
# 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' and rc's nginx container's image to 'nginx:1.9.1'
kubectl set image deployments,rc 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

.fi
.RE


.SH SEE ALSO
.PP
\fBkubectl\-set(1)\fP,


.SH HISTORY
.PP
January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since!
2 changes: 1 addition & 1 deletion docs/man/man1/kubectl-set.1
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ These commands help you make changes to existing application resources.

.SH SEE ALSO
.PP
\fBkubectl(1)\fP,
\fBkubectl(1)\fP, \fBkubectl\-set\-image(1)\fP,


.SH HISTORY
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/kubectl/kubectl_autoscale.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ kubectl autoscale rc foo --max=5 --cpu-percent=80

```
--cpu-percent=-1: The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, the server will apply a default value.
--dry-run[=false]: If true, only print the object that would be sent, without creating it.
--dry-run[=false]: If true, only print the object that would be sent, without sending it.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to autoscale.
--generator="horizontalpodautoscaler/v1beta1": The name of the API generator to use. Currently there is only 1 generator.
--include-extended-apis[=true]: If true, include definitions of new APIs via calls to the API server. [default true]
Expand Down Expand Up @@ -113,7 +113,7 @@ kubectl autoscale rc foo --max=5 --cpu-percent=80

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra on 30-Mar-2016
###### Auto generated by spf13/cobra on 13-May-2016

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_autoscale.md?pixel)]()
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/kubectl/kubectl_expose.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ kubectl expose deployment nginx --port=80 --target-port=8000
### Options

```
--dry-run[=false]: If true, only print the object that would be sent, without creating it.
--dry-run[=false]: If true, only print the object that would be sent, without sending it.
--external-ip="": Additional external IP address (not managed by Kubernetes) to accept for the service. If this IP is routed to a node, the service can be accessed by this IP in addition to its generated service IP.
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to expose a service
--generator="service/v2": The name of the API generator to use. There are 2 generators: 'service/v1' and 'service/v2'. The only difference between them is that service port in v1 is named 'default', while it is left unnamed in v2. Default is 'service/v2'.
Expand Down Expand Up @@ -143,7 +143,7 @@ kubectl expose deployment nginx --port=80 --target-port=8000

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra on 11-May-2016
###### Auto generated by spf13/cobra on 13-May-2016

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]()
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/kubectl/kubectl_rolling-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ kubectl rolling-update frontend-v1 frontend-v2 --rollback
```
--container="": Container name which will have its image upgraded. Only relevant when --image is specified, ignored otherwise. Required when using --image on a multi-container pod
--deployment-label-key="deployment": The key to use to differentiate between two different controllers, default 'deployment'. Only relevant when --image is specified, ignored otherwise
--dry-run[=false]: If true, print out the changes that would be made, but don't actually make them.
--dry-run[=false]: If true, only print the object that would be sent, without sending it.
-f, --filename=[]: Filename or URL to file to use to create the new replication controller.
--image="": Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f
--image-pull-policy="": Explicit policy for when to pull container images. Required when --image is same as existing image, ignored otherwise.
Expand Down Expand Up @@ -127,7 +127,7 @@ kubectl rolling-update frontend-v1 frontend-v2 --rollback

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager

###### Auto generated by spf13/cobra on 21-Apr-2016
###### Auto generated by spf13/cobra on 13-May-2016

<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]()
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/kubectl/kubectl_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ kubectl set SUBCOMMAND
### SEE ALSO

* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
* [kubectl set image](kubectl_set_image.md) - Update image of a pod template

###### Auto generated by spf13/cobra on 10-May-2016

Expand Down