Maximize Your Kubectl Productivity With Shortcut Names for Kubernetes Resources
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.
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
On the left hand side, I will put the full resource name as defined by kubectl. On the right side, I will put the possible shortname(s). Note that there could be more than one possible shortname for each resource, which I will comma separate.
Note that your cluster could have more or less shortnames depending on which API Groups you have available.
customresourcedefinitions= crd, crds
certificiaterequests= cr, crs
certificates= cert, certs
See for yourself in kubectl
If you want a reference for your specific Kubernetes cluster, then you should be able to run the following command and get a list of shortnames for your API resources: