DevOps tips

Quick DevOps tips

One practical fix per tip: a command or setting you can use today, from real AWS, Kubernetes, Terraform and CI/CD work. Each tip has a matching YouTube Short.

Why is my pod restarting? 3 kubectl commands

Stop guessing why a pod keeps restarting. Three commands show the restart count, the reason and the logs from the crashed container.

  1. Confirm the crash loop. A high RESTARTS count means the container keeps dying and Kubernetes keeps starting it again.

    kubectl get pods
  2. Find the reason. Look under "Last State". OOMKilled with exit code 137 means the container ran out of memory; Error means the application itself exited.

    kubectl describe pod <pod-name>
  3. Read the logs from the container that crashed. Plain kubectl logs shows the new container, which has not failed yet; --previous shows the one that did.

    kubectl logs <pod-name> --previous

OOMKilled usually means the memory limit is too low for real traffic, or the application leaks memory. Measure with kubectl top pods before raising the limit.

Go deeper: 3 Kubernetes mistakes that crash your pods

Why is my pod restarting? 3 kubectl commandsRestart count, the reason in Last State, and logs from the crashed container.

Find your biggest AWS cost in 1 command

You do not need to read the whole invoice. One Cost Explorer command shows what each AWS service cost this month, and the same command grouped by region finds forgotten resources.

  1. Cost per service for the month so far. Change the dates to the period you want; the end date is exclusive.

    aws ce get-cost-and-usage \
      --time-period Start=2026-10-01,End=2026-10-18 \
      --granularity MONTHLY \
      --metrics UnblendedCost \
      --group-by Type=DIMENSION,Key=SERVICE
  2. The same command grouped by region. A region nobody uses that still shows cost is usually a forgotten test.

    aws ce get-cost-and-usage \
      --time-period Start=2026-10-01,End=2026-10-18 \
      --granularity MONTHLY \
      --metrics UnblendedCost \
      --group-by Type=DIMENSION,Key=REGION
  3. Get warned before the invoice. Create a monthly budget with an email alert at 80%. The two JSON files hold the budget amount and the alert settings.

    aws budgets create-budget \
      --account-id 123456789012 \
      --budget file://budget.json \
      --notifications-with-subscribers file://alert-80.json

Cost Explorer must be enabled on the account, and each Cost Explorer API request costs $0.01, so run it when you need it rather than in a tight loop.

Go deeper: 3 AWS charges billing you for nothing

Find your biggest AWS cost in 1 commandCost per service, cost per region, and a budget alert at 80%.

Want these fixes applied to your setup?

Tell me what you run today and I'll tell you what to fix first. Free.

Get a Free AWS Review