post · January 5, 2025 · 1 min read
Do I memorize all the Kubernetes short names?
By Saleh Elnagar
Not a chance. I outsource that memory to kubectl and keep my brain for coffee orders and incident timelines. ☕🚀
Here’s how I look clever without memorizing a phone book of resources:
1) See every resource + its short name
kubectl api-resources
This shows NAME, SHORTNAMES, APIGROUP, NAMESPACED, KIND.
2) When you remember the full name and want the short name
kubectl api-resources | grep -w pods # → ... SHORTNAMES: po
3) When you remember only the short name and want the full name
# Replace 'ds' with the short name you half-remember
kubectl api-resources | awk '$2 ~ /(^|,)ds(,|$)/' # Matches exact short names in the SHORTNAMES column
4) Sanity‑check the type (short names work here too)
kubectl explain po # pods
kubectl explain deploy # deployments
5) Filter by API group when you’re feeling fancy
kubectl api-resources --api-group=apps
Mini cheat sheet (so your thumbs can rest):po=pods, svc=services, deploy=deployments, ds=daemonsets, sts=statefulsets, rs=replicasets, ing=ingresses, cm=configmaps, sa=serviceaccounts, ns=namespaces, hpa=horizontalpodautoscalers, pvc=persistentvolumeclaims, pv=persistentvolumes, crd=customresourcedefinitions, no=nodes, cj=cronjobs.
Pro tip: Short names can vary across clusters because CRDs (custom resources) can define their own. Trust discovery over memory—your future self will thank you.
Ship value, not trivia. Let kubectl do the remembering so you can do the engineering. 🛠️✨
#Kubernetes #kubectl #DevOps #PlatformEngineering #Productivity #TipsAndTricks
Quick AI Summary
Not a chance. I outsource that memory to kubectl and keep my brain for coffee orders and incident timelines.
Original article body above remains unchanged.
Continue Reading
Related Posts
Ingress migrations are rarely “just routing.” They’re one of the few moments where you’re forced to touch the edge, which means you can also fix the stuff that quietly rots over time: The core move is simple: Don’t migrate YAML → YAML. Migrate to a desired state — and encode that state as Terraform. This […]
Repository: https://github.com/SalehElnagar/azure-terraform-conventions This article walks through how to think about Azure naming conventions and how to turn those decisions into code using the azure-terraform-conventions GitHub repository. That repo contains: The goal is not “just use whatever the repo does”. The goal is: capture your organization’s naming decisions once, codify them with this library, and then […]
When I sit down to craft a Terraform module, I ask myself how future me—and the teams inheriting my code—will reason about every decision. I remind myself to start with clarity, keep security opinionated but flexible, and prove the workflow end to end before anyone else runs terraform apply. I literally keep a checklist on […]
Get New Playbooks Weekly
Join the newsletter for practical Azure, Terraform, and DevSecOps guides. One actionable email per week.
Comments
Enable comments by setting NEXT_PUBLIC_GISCUS_* environment variables.