How to rollbac...
How to rollbac...
To rollback a Deployment in Kubernetes, you can use the kubectl rollout
command. Here is a step-by-step guide on how to perform a rollback:
List Deployments:
First, list all the Deployments in your cluster to identify the one you want to rollback:
kubectl get deployments
This command will display the status of all Deployments in your cluster.
Check Revision History:
Obtain the revision history of the specific Deployment you want to rollback. Replace <deployment_name>
with the name of your Deployment:
kubectl rollout history deployment/<deployment_name>
This command will show the revision history, including the change causes for each revision.
Rollback to a Specific Revision:
To rollback to a specific revision, use the following command. Replace <revision_number>
with the desired revision number:
kubectl rollout undo deployment/<deployment_name> --to-revision=<revision_number>
This command will rollback the Deployment to the specified revision.
Verify Rollback:
After performing the rollback, verify that it was successful by checking the status of the Deployment:
kubectl rollout status deployment/<deployment_name>
If the rollback was successful, you should see a message indicating a successful rollout.
Check Deployment Details:
Optionally, you can describe the Deployment to get more details about its current state:
kubectl describe deployment/<deployment_name>
Here is an example of roll...
senior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào