10 Kubernetes Commands Every DevOps Engineer Uses Daily

Master the 10 most essential kubectl commands that real DevOps and platform engineers run every single day in 2025. Includes practical examples, aliases, and pro tips for debugging, scaling, logs, and cluster operations.

Dec 8, 2025 - 14:23
 0  1

Introduction

Kubernetes is powerful, but you don’t need to memorize 300+ kubectl commands to be effective. In real production environments in 2025, 95% of daily work is done with just 10 core commands (plus a few aliases). Whether you’re debugging a crashing pod, checking resource usage, or helping a developer access a service, these are the exact commands elite teams use hundreds of times per day.

Most clusters run securely inside a well-segmented Virtual Private Cloud (VPC) with private API endpoints.

1. kubectl get – Your Daily Dashboard

The single most used command. Always start here.

  • kubectl get pods -A → see every pod in the cluster
  • kubectl get pods -n production → specific namespace
  • kubectl get nodes → check worker node status
  • kubectl get svc,ing,deploy → quick overview

Pro tip: alias kkubectl and use kgp for kubectl get pods

2. kubectl describe – When You Need the Full Story

kubectl describe shows events, conditions, and recent history.

  • kubectl describe pod <name> → see why a pod is CrashLoopBackOff
  • kubectl describe node <node-name> → check taints, capacity, events
  • kubectl describe ingress <name> → verify TLS and backend rules

Events section at the bottom is pure gold during incidents.

3. kubectl logs – Follow What’s Happening Inside

Essential for debugging and monitoring.

  • kubectl logs -f pod-name -c container-name → tail live logs
  • kubectl logs --since=10m pod-name → last 10 minutes
  • kubectl logs --previous pod-name → logs from crashed instance

Even with Loki/Grafana, engineers still reach for kubectl logs first.

Pods in private subnets still expose logs securely through the control plane or NAT Gateway-enabled agents.

4. kubectl exec – Jump Inside a Running Container

The Swiss Army knife for troubleshooting.

  • kubectl exec -it pod-name -- sh
  • kubectl exec -it deploy/my-app -- curl localhost:8080/health
  • kubectl cp pod-name:/app/logs . → copy files

5. kubectl top – Real-Time Resource Monitoring

Instant visibility into CPU/memory usage.

  • kubectl top pods -n production
  • kubectl top nodes → spot overloaded workers
  • Sort with --sort-by=cpu

6. kubectl port-forward – Instant Local Access

Developers love this for testing without Ingress.

  • kubectl port-forward svc/my-db 5432:5432 → connect pgAdmin locally
  • kubectl port-forward deploy/api 8080:80 → test API on localhost:8080

Works perfectly even when services are in private subnets – no public exposure needed.

7. kubectl scale – Instant Scaling Up/Down

For emergencies or load tests.

  • kubectl scale deploy/api --replicas=20
  • kubectl scale statefulset/db --replicas=0 → quick maintenance

8. kubectl apply -f – The Correct Way to Apply Changes

Never use create in production.

  • kubectl apply -f manifest.yaml
  • kubectl apply -k ./kustomize/overlays/prod
  • GitOps tools (ArgoCD/Flux) use this under the hood

9. kubectl delete – Clean Up Fast

Sometimes you just need it gone.

  • kubectl delete pod --grace-period=0 --force pod-name → kill stuck terminating pod
  • kubectl delete ns stuck-namespace --grace-period=0 --force

10. kubectl config Commands – Switch Contexts Like a Pro

Real engineers manage 5–20 clusters daily.

  • kubectl config get-contexts → list all clusters
  • kubectl config use-context prod-us-east-1
  • Alias kubectx and kubens tools save hours

Essential kubectl Cheat Sheet Table

Command Purpose Real-World Example
kubectl get pods -A See all pods cluster-wide Morning health check
kubectl describe pod xyz Debug failing pod OOMKilled, ImagePullBackOff
kubectl logs -f pod --tail=200 Live application logs Error investigation
kubectl exec -it pod -- sh Interactive shell Check files, curl health
kubectl top nodes Cluster resource usage Capacity planning
kubectl port-forward svc/db 5432 Local DB access Developer testing

Conclusion

Master these 10 kubectl commands and you’ll handle 99% of day-to-day Kubernetes operations with confidence. Combine them with tools like k9s, lens, or stern for even more power. The best engineers have these memorized – and so should you. Bookmark this page, add the aliases to your ~/.zshrc or ~/.bashrc, and watch your productivity soar.

Frequently Asked Questions

What is the most used kubectl command?

kubectl get pods – run hundreds of times per day by most engineers.

Should I use k9s instead of raw kubectl?

Yes for exploration, but know raw kubectl for scripts and incidents.

How do I see why a pod is pending?

kubectl describe pod <name> → look at Events section.

Can I use kubectl with multiple clusters?

Yes – manage contexts with kubectl config use-context.

Is kubectl safe on production clusters?

Yes with RBAC. Most teams grant read-only to developers and full access only to platform team.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Angry Angry 0
Sad Sad 0
Wow Wow 0
Mridul I am a passionate technology enthusiast with a strong focus on DevOps, Cloud Computing, and Cybersecurity. Through my blogs at DevOps Training Institute, I aim to simplify complex concepts and share practical insights for learners and professionals. My goal is to empower readers with knowledge, hands-on tips, and industry best practices to stay ahead in the ever-evolving world of DevOps.