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 examples using "rollout" #10583

Merged
merged 2 commits into from
Nov 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions content/en/docs/reference/kubectl/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,20 @@ kubectl get events --sort-by=.metadata.creationTimestamp

## Updating Resources

As of version 1.11 `rolling-update` have been deprecated (see [CHANGELOG-1.11.md](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.11.md)), use `rollout` instead.

```bash
kubectl rolling-update frontend-v1 -f frontend-v2.json # Rolling update pods of frontend-v1
kubectl rolling-update frontend-v1 frontend-v2 --image=image:v2 # Change the name of the resource and update the image
kubectl rolling-update frontend --image=image:v2 # Update the pods image of frontend
kubectl rolling-update frontend-v1 frontend-v2 --rollback # Abort existing rollout in progress
cat pod.json | kubectl replace -f - # Replace a pod based on the JSON passed into stdin
kubectl set image deployment/frontend www=image:v2 # Rolling update "www" containers of "frontend" deployment, updating the image
kubectl rollout undo deployment/frontend # Rollback to the previous deployment
kubectl rollout status -w deployment/frontend # Watch rolling update status of "frontend" deployment until completion

# deprecated starting version 1.11
kubectl rolling-update frontend-v1 -f frontend-v2.json # (deprecated) Rolling update pods of frontend-v1
kubectl rolling-update frontend-v1 frontend-v2 --image=image:v2 # (deprecated) Change the name of the resource and update the image
kubectl rolling-update frontend --image=image:v2 # (deprecated) Update the pods image of frontend
kubectl rolling-update frontend-v1 frontend-v2 --rollback # (deprecated) Abort existing rollout in progress

cat pod.json | kubectl replace -f - # Replace a pod based on the JSON passed into std

# Force replace, delete and then re-create the resource. Will cause a service outage.
kubectl replace --force -f ./pod.json
Expand Down