Rollback Steps For Failure in Certificate Updates

This section describes the commands that can be executed to restore the certificates and config files to their previous state, in the event of a certificate update failure.
Note: The pods can either be in the Init:CrashLoopBackOff state or the Pending state.
  1. Init:CrashLoopBackOff: If the pod is in this state, delete the pods by executing the command
    kubectl delete pod <podname> -n <namespace> –force
  2. Pending: If the pod is in this state, execute the commands in the order mentioned below:
    1. kubectl scale –replicas=0 deploy/<component name> -n <namespace>
    2. kubectl get pods --all-namespaces | awk '{if ($4=="Terminating") print "kubectl delete pod " $2 " -n " $1 " --force --grace-period=0 ";}' | sh > /dev/null 2>&1
    3. kubectl scale –replicas=3 deploy/<component name> -n <namespace>

    Replicas can be changed based on the initial setup.