Rollback deployment

Revert to the previous revision

kubectl rollout undo deployment/<name> -n <ns>

tool
kubectl73 commands
tags
deployments

More kubectl commands

  • kubectl scale deployment/<name> --replicas=3 -n <ns>

    Immediately change replica count

  • kubectl get events -A --sort-by='.lastTimestamp'

    Recent cluster events, oldest first — great for post-incident review

  • kubectl apply --server-side --dry-run=server -f file.yaml

    Validate manifest against live API without applying changes

  • kubectl get deployment/<name> -n <ns> -o yaml

    Current live state with managed fields stripped; useful as a base

  • kubectl delete pod <name> -n <ns> --grace-period=0 --force

    Remove a Terminating pod immediately (use with caution)

all 73 kubectl commands