How do you roll back a failed deployment in Kubernetes using Jenkins?
TechnicalTech lead javaJava Tech LeadDevOps EngineerSoftware EngineerTo roll back a failed deployment in Kubernetes using Jenkins, I would first identify the problematic deployment version. Then, I would use the kubectl rollout undo command targeting the specific deployment. This command reverts the deployment to the last stable state.
Additionally, I would ensure that Jenkins is configured to trigger this rollback automatically upon detecting a failure, using a post-build action in the pipeline. This minimizes downtime and maintains service reliability.