Maximize Your Kubectl Productivity With Shortcut Names for Kubernetes Resources

Tremaine Eto
Aug 4, 2020 · 2 min read
Photo by Ihor Dvoretskyi on Unsplash

Whether you’re a frequent or occasional user of the kubectl Command Line Interface (CLI), you probably have had the desire to become as efficient as possible and limit keystrokes where possible. It’s also very likely that you have come across various shortcut aliases for Kubernetes resources.

To truly maximize your productivity, you will want to fully utilize these identifiers.

For instance, you can get a list of all deployments in a namespace with the following command:

With an alias for deployments, though, we can shorten what you actually will type.

Effectively, deployments can be referred to as deploy . It turns out that Kubernetes actually has a lot of these shortcuts, which it calls shortnames.

List of shortnames

Note that your cluster could have more or less shortnames depending on which API Groups you have available.

  • componentstatuses = cs
  • configmaps = cm
  • endpoints = ep
  • events = ev
  • limitranges = limits
  • namespaces = ns
  • nodes = no
  • persistentvolumeclaims = pvc
  • persistentvolumes = pv
  • pods = po
  • replicationcontrollers = rc
  • resourcequotas = quota
  • serviceaccounts = sa
  • services = svc
  • customresourcedefinitions = crd, crds
  • daemonsets = ds
  • deployments = deploy
  • replicasets = rs
  • statefulsets = sts
  • horizontalpodautoscalers = hpa
  • cronjobs = cj
  • certificiaterequests = cr, crs
  • certificates = cert, certs
  • certificatesigningrequests = csr
  • ingresses = ing
  • networkpolicies = netpol
  • podsecuritypolicies = psp
  • replicasets = rs
  • scheduledscalers = ss
  • priorityclasses = pc
  • storageclasses = sc

See for yourself in kubectl

The Startup

Get smarter at building your thing. Join The Startup’s +724K followers.

Tremaine Eto

Written by

Full-time software engineer since 2016. UCLA Computer Science B.S. with Atmospheric and Oceanic Sciences minor, class of ‘16.

The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +724K followers.

Tremaine Eto

Written by

Full-time software engineer since 2016. UCLA Computer Science B.S. with Atmospheric and Oceanic Sciences minor, class of ‘16.

The Startup

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +724K followers.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store