rollout
Rollback to the previous deployment
kubectl rollout undo deployment/abc
Check the rollout status of a daemonset
kubectl rollout status daemonset/foo
Manage the rollout of a resource.
Valid resource types include:
- deployments
- daemonsets
- statefulsets
Usage
$ kubectl rollout SUBCOMMAND
history
View the rollout history of a deployment
kubectl rollout history deployment/abc
View the details of daemonset revision 3
kubectl rollout history daemonset/abc --revision=3
View previous rollout revisions and configurations.
Usage
$ kubectl rollout history (TYPE NAME | TYPE/NAME) [flags]
Flags
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
kustomize | k | Process the kustomization directory. This flag can’t be used together with -f or -R. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
recursive | R | false | Process the directory used in -f, —filename recursively. Useful when you want to manage related manifests organized within the same directory. |
revision | 0 | See the details, including podTemplate of the revision specified | |
show-managed-fields | false | If true, keep the managedFields when printing objects in JSON or YAML format. | |
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]. |
pause
Mark the nginx deployment as paused # Any current state of the deployment will continue its function; new updates # to the deployment will not have an effect as long as the deployment is paused
kubectl rollout pause deployment/nginx
Mark the provided resource as paused.
Paused resources will not be reconciled by a controller. Use “kubectl rollout resume” to resume a paused resource. Currently only deployments support being paused.
Usage
$ kubectl rollout pause RESOURCE
Flags
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
field-manager | kubectl-rollout | Name of the manager used to track field ownership. | |
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
kustomize | k | Process the kustomization directory. This flag can’t be used together with -f or -R. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
recursive | R | false | Process the directory used in -f, —filename recursively. Useful when you want to manage related manifests organized within the same directory. |
show-managed-fields | false | If true, keep the managedFields when printing objects in JSON or YAML format. | |
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]. |
restart
Restart a deployment
kubectl rollout restart deployment/nginx
Restart a daemon set
kubectl rollout restart daemonset/abc
Restart a resource.
Resource rollout will be restarted.
Usage
$ kubectl rollout restart RESOURCE
Flags
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
field-manager | kubectl-rollout | Name of the manager used to track field ownership. | |
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
kustomize | k | Process the kustomization directory. This flag can’t be used together with -f or -R. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
recursive | R | false | Process the directory used in -f, —filename recursively. Useful when you want to manage related manifests organized within the same directory. |
show-managed-fields | false | If true, keep the managedFields when printing objects in JSON or YAML format. | |
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]. |
resume
Resume an already paused deployment
kubectl rollout resume deployment/nginx
Resume a paused resource.
Paused resources will not be reconciled by a controller. By resuming a resource, we allow it to be reconciled again. Currently only deployments support being resumed.
Usage
$ kubectl rollout resume RESOURCE
Flags
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
field-manager | kubectl-rollout | Name of the manager used to track field ownership. | |
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
kustomize | k | Process the kustomization directory. This flag can’t be used together with -f or -R. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
recursive | R | false | Process the directory used in -f, —filename recursively. Useful when you want to manage related manifests organized within the same directory. |
show-managed-fields | false | If true, keep the managedFields when printing objects in JSON or YAML format. | |
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]. |
status
Watch the rollout status of a deployment
kubectl rollout status deployment/nginx
Show the status of the rollout.
By default ‘rollout status’ will watch the status of the latest rollout until it’s done. If you don’t want to wait for the rollout to finish then you can use —watch=false. Note that if a new rollout starts in-between, then ‘rollout status’ will continue watching the latest revision. If you want to pin to a specific revision and abort if it is rolled over by another revision, use —revision=N where N is the revision you need to watch for.
Usage
$ kubectl rollout status (TYPE NAME | TYPE/NAME) [flags]
Flags
Name | Shorthand | Default | Usage |
---|---|---|---|
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
kustomize | k | Process the kustomization directory. This flag can’t be used together with -f or -R. | |
recursive | R | false | Process the directory used in -f, —filename recursively. Useful when you want to manage related manifests organized within the same directory. |
revision | 0 | Pin to a specific revision for showing its status. Defaults to 0 (last revision). | |
timeout | 0s | The length of time to wait before ending watch, zero means never. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h). | |
watch | w | true | Watch the status of the rollout until it’s done. |
undo
Roll back to the previous deployment
kubectl rollout undo deployment/abc
Roll back to daemonset revision 3
kubectl rollout undo daemonset/abc --to-revision=3
Roll back to the previous deployment with dry-run
kubectl rollout undo --dry-run=server deployment/abc
Roll back to a previous rollout.
Usage
$ kubectl rollout undo (TYPE NAME | TYPE/NAME) [flags]
Flags
Name | Shorthand | Default | Usage |
---|---|---|---|
allow-missing-template-keys | true | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | |
dry-run | none | Must be “none”, “server”, or “client”. If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | |
filename | f | [] | Filename, directory, or URL to files identifying the resource to get from a server. |
kustomize | k | Process the kustomization directory. This flag can’t be used together with -f or -R. | |
output | o | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file. | |
recursive | R | false | Process the directory used in -f, —filename recursively. Useful when you want to manage related manifests organized within the same directory. |
show-managed-fields | false | If true, keep the managedFields when printing objects in JSON or YAML format. | |
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]. | ||
to-revision | 0 | The revision to rollback to. Default to 0 (last revision). |