Last active
September 14, 2020 09:08
-
-
Save schneefisch/078d2a776cce220242dc80bff27c1910 to your computer and use it in GitHub Desktop.
Update deployments in kubernetes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to do updates to your environment | |
# more details to deployments and scaling: | |
# https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ | |
# 1. update the deployment.yml file and run | |
kubectl apply -f <deployment.yml> | |
# 2. update an image: | |
kubectl set image <deployment/nginx-deployment> <nginx>=<nginx:1.9.1> | |
######## | |
# monitor deployments | |
# Check the rollout status | |
kubectl rollout status <deployment/nginx-deployment> | |
kubectl rollout status deployments <nginx-deployment> | |
# Check replicas | |
kubectl get rs | |
# check pods | |
kubectl get pods | |
# describe deployment | |
kubectl describe deployment | |
######## | |
# Roll-Back | |
# check rollout history | |
kubectl rollout history <deployment/nginx-deployment> | |
kubectl rollout history <deployment/nginx-deployment> --revision=2 | |
# roll back to previous revision | |
kubectl rollout undo <deployment/nginx-deployment> | |
# or choose a specific revision | |
kubectl rollout undo <deployment/nginx-deployment> --to-revision=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment