How to Rollback Your Kubernetes Deployment with Kubectl
Learn how to rollback a Kubernetes deployment to a previous version using kubectl commands. Follow our guide to ensure stability in your cluster.
Learn how to rollback a Kubernetes deployment to a previous version using kubectl commands. Follow our guide to ensure stability in your cluster.
If you encounter performance issues or bugs caused by a new Deployment to your Kubernetes cluster, you should rollback to a previous version while you investigate. By doing this, you’ll minimize downtime and be able to resolve issues like data loss or security vulnerabilities introduced by the new Deployment.
In this guide, we’ll show you how to roll back your Deployment, verify that it was successful, and get details about your problematic deployment.
You can use the kubectl commands to roll back to a previously tested Kubernetes Deployment. Here’s how:
You’ll see an output that looks like this:
You’ll see an output that looks like this:
You can see in this example there is a typo in the 3rd revision, updating image “1.121” instead of image “1.12.1”.
You can check whether the rollback to a previous Kubernetes Deployment was successful with a couple commands.
If the status displays a message like "successful rollout" or "rolled out," it means you succeeded in deploying the previous Kubernetes revision
Rolling back a problematic deployment isn’t hard, but it does require you to remember which commands to run and what information to look for. In the time it takes to manually rollback your deployment, your application may experience downtime or subpar performance.
With Blink, you can use event triggers like a PagerDuty or Datadog incident to automatically rollback to the previous deployment and update the incident ticket.
This automation in the Blink library is triggered when a related Datadog incident is created. When it runs, it does the following steps:
You can import this automation from the library into your account and customize it based on your organization’s needs. For example, you can drag-and-drop new actions into the canvas to add notifications, approval steps, and conditional subflows.
You can also kick off other automations to gather troubleshooting information so your development team can quickly understand what went wrong.
With Blink, you can build your own automation from scratch or use one of our 5K pre-built automations today.
Get started with Blink today to see how easy automation can be.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.