Revert Deployment to Previous Version in Kubernetes

Revert Deployment to Previous Version in Kubernetes

How to Roll Back to a Previous Deployment Version in Kubernetes

Table of contents

Tasks

  • Rollback the deployment named nginx-deployment to the previous revision.

Steps

  1. Check the existing deployments

     kubectl get deployments
    

  2. Roll Back the Deployment

     kubectl rollout undo deployment/nginx-deployment
    

  3. Now verfify with status

     kubectl rollout status deployment/nginx-deployment
    

  4. List pods

     kubectl get pods
    

  5. Confirm the image version

     kubectl describe deployment nginx-deployment
    

    You can see image version is nginx:1.16 now.

  6. Out of the box, chill method with 404 error;

    #k8s #revert #happylearning