mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-06 03:33:26 +00:00
Add 'kubectl set image'
This commit is contained in:
@@ -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]
|
||||
@@ -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 -->
|
||||
[]()
|
||||
|
@@ -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'.
|
||||
@@ -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 -->
|
||||
[]()
|
||||
|
@@ -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.
|
||||
@@ -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 -->
|
||||
[]()
|
||||
|
@@ -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
|
||||
|
||||
|
116
docs/user-guide/kubectl/kubectl_set_image.md
Normal file
116
docs/user-guide/kubectl/kubectl_set_image.md
Normal file
@@ -0,0 +1,116 @@
|
||||
<!-- BEGIN MUNGE: UNVERSIONED_WARNING -->
|
||||
|
||||
<!-- BEGIN STRIP_FOR_RELEASE -->
|
||||
|
||||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
<img src="http://kubernetes.io/img/warning.png" alt="WARNING"
|
||||
width="25" height="25">
|
||||
|
||||
<h2>PLEASE NOTE: This document applies to the HEAD of the source tree</h2>
|
||||
|
||||
If you are using a released version of Kubernetes, you should
|
||||
refer to the docs that go with that version.
|
||||
|
||||
Documentation for other releases can be found at
|
||||
[releases.k8s.io](http://releases.k8s.io).
|
||||
</strong>
|
||||
--
|
||||
|
||||
<!-- END STRIP_FOR_RELEASE -->
|
||||
|
||||
<!-- END MUNGE: UNVERSIONED_WARNING -->
|
||||
|
||||
## kubectl set image
|
||||
|
||||
Update image of a pod template
|
||||
|
||||
### Synopsis
|
||||
|
||||
|
||||
Update existing container image(s) of resources.
|
||||
|
||||
Possible resources include (case insensitive):
|
||||
pod (po), replicationcontroller (rc), deployment, daemonset (ds), job, replicaset (rs)
|
||||
|
||||
```
|
||||
kubectl set image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
```
|
||||
# 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
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
```
|
||||
--all[=false]: select all resources in the namespace of the specified resource types
|
||||
-f, --filename=[]: Filename, directory, or URL to a file identifying the resource to get from a server.
|
||||
--local[=false]: If true, set image will NOT contact api-server but run locally.
|
||||
--no-headers[=false]: When using the default output, don't print headers.
|
||||
-o, --output="": Output format. One of: json|yaml|wide|name|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md].
|
||||
--output-version="": Output the formatted object with the given group version (for ex: 'extensions/v1beta1').
|
||||
--record[=false]: Record current kubectl command in the resource annotation.
|
||||
-R, --recursive[=false]: If true, process directory recursively.
|
||||
-l, --selector="": Selector (label query) to filter on
|
||||
-a, --show-all[=false]: When printing, show all resources (default hide terminated pods.)
|
||||
--show-labels[=false]: When printing, show all labels as the last column (default hide labels column)
|
||||
--sort-by="": 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.
|
||||
--template="": Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview].
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--alsologtostderr[=false]: log to standard error as well as files
|
||||
--as="": Username to impersonate for the operation.
|
||||
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||
--client-certificate="": Path to a client certificate file for TLS.
|
||||
--client-key="": Path to a client key file for TLS.
|
||||
--cluster="": The name of the kubeconfig cluster to use
|
||||
--context="": The name of the kubeconfig context to use
|
||||
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
|
||||
--log-dir="": If non-empty, write log files in this directory
|
||||
--log-flush-frequency=5s: Maximum number of seconds between log flushes
|
||||
--logtostderr[=true]: log to standard error instead of files
|
||||
--match-server-version[=false]: Require server version to match client version
|
||||
--namespace="": If present, the namespace scope for this CLI request.
|
||||
--password="": Password for basic authentication to the API server.
|
||||
-s, --server="": The address and port of the Kubernetes API server
|
||||
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||
--token="": Bearer token for authentication to the API server.
|
||||
--user="": The name of the kubeconfig user to use
|
||||
--username="": Username for basic authentication to the API server.
|
||||
--v=0: log level for V logs
|
||||
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
* [kubectl set](kubectl_set.md) - Set specific features on objects
|
||||
|
||||
###### Auto generated by spf13/cobra on 17-May-2016
|
||||
|
||||
<!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
|
||||
[]()
|
||||
<!-- END MUNGE: GENERATED_ANALYTICS -->
|
Reference in New Issue
Block a user