Skip to main content

Command Palette

Search for a command to run...

Revert Deployment to Previous Version in Kubernetes

How to Roll Back to a Previous Deployment Version in Kubernetes

Updated
1 min read
Revert Deployment to Previous Version in Kubernetes
A

Infosec Poet and CAP-certified DevOps/SecOps Engineer, passionate about security, creativity, and continuous learning.

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

DevOps

Part 4 of 10

In this series, I will cover various DevOps practices, tools, CI/CD pipelines, infrastructure as code, automation tips, and troubleshooting techniques.

Up next

Execute Rolling Updates in Kubernetes

Step-by-Step Guide to Rolling Updates in Kubernetes