Two Commands I Run Before Every Production Deploy

TL;DR

  • Compare both the intended code changes and cluster changes before every production deployment.
  • git diff --stat origin/main...HEAD shows the release scope, while kubectl diff -f k8s/ reveals what Kubernetes will change.
  • Predictable, boring output is a strong signal that the deployment is understood.

This is a small habit, but it has saved me more than once.

Before every production deploy, I run:

git diff --stat origin/main...HEAD

and

kubectl diff -f k8s/

The first tells me exactly what is changing in the release.
The second tells me exactly what the cluster will change.

No guesswork. No “I thought this file wasn’t included.” No accidental config drift.

When the output looks boring, I’m happy.
Boring deploys are usually healthy deploys.