This cheat sheet refers to the Kubectl plugin for Oh My Zsh.
Note: Unless otherwise stated, commands work within the current Namespace context. Use -n
|--namespace <namespace>
as part of the command-line to change the target.
Aliases
|
The kubectl command. |
|
Apply resources as described by the YAML file(s) specified after the |
|
Apply the subsequent command across all Namespaces. |
|
Display the current context. |
|
Delete the specified context from the kubeconfig file. |
|
List all available contexts. |
|
Change the current Namespace context. |
|
Copy files and directories to/from containers. |
|
Set a context entry in kubeconfig file. |
|
Set the current context in the kubeconfig file. |
|
Display details about CronJob resource(s). |
|
Display details about ConfigMap resource(s). |
|
Display details about Deployment resource(s). |
|
Display details about DaemonSet resource(s). |
|
Delete resources by filenames, stdin, resources and names, or by resources and label selector. |
|
Delete CronJob resources matching the name(s) passed. |
|
Delete ConfigMap resources matching the name(s) passed. |
|
Delete Deployment resources matching the name(s) passed. |
|
Delete DaemonSets resources matching the name(s) passed. |
|
Delete resources described by the YAML file(s) specified with the |
|
Delete Ingress resources matching the name(s) passed. |
|
Delete Job resources matching the name(s) passed. |
|
Delete Node resources matching the name(s) passed. |
|
Delete the specified Namespace(s). WARNING: This deletes everything in the Namespace! |
|
Delete Pod resources matching the name(s) passed. |
|
Delete PersistentVolumeClaim resources matching the name(s) passed. |
|
Delete Service resources matching the name(s) passed. |
|
Delete ServiceAccount resources matching the name(s) passed. |
|
Delete Secret resources matching the name(s) passed. |
|
Delete StatefulSet resources matching the name(s) passed. |
|
Display details about Ingress resource(s). |
|
Display details about Job resources(s). |
|
Display details about Node resources(s). |
|
Display details about Namespace resources(s). |
|
Display details about Pod resources(s). |
|
Display details about PersistentVolumeClaim resources(s). |
|
Display details about ReplicaSet resources(s). |
|
Display details about Service resources(s). |
|
Display details about ServiceAccount resources(s). |
|
Display details about Secret resource(s). |
|
Display details about StatefulSet resource(s). |
|
Edit a CronJob with the default editor. |
|
Edit a ConfigMap with the default editor. |
|
Edit a Deployment with the default editor. |
|
Edit a DaemonSet with the default editor. |
|
Edit an Ingress with the default editor. |
|
Edit a Job with the default editor. |
|
Edit a Node with the default editor. |
|
Edit a Namespace with the default editor. |
|
Edit a Pod with the default editor. |
|
Edit a PersistentVolumeClaim with the default editor. |
|
Edit a ReplicaSet with the default editor. |
|
Edit a Service (svc) with the default editor. |
|
Edit a StatefulSet with the default editor. |
|
Open an interactive terminal session in a container. |
|
List all resources in tabular output format. |
|
List all resources across all Namespaces in the cluster (tabular output). |
|
List specified/all CronJobs in tabular output format. |
|
List specified/all ConfigMaps in tabular output format. |
|
List specified/all Deployments in tabular output format. |
|
List specified/all DaemonSets in tabular output format. |
|
List specified/all DaemonSets and watch for changes. |
|
List specified/all Deployments and watch for changes. |
|
List specified/all Deployments with additional columns of information. |
|
List specified/all Ingresses in tabular output format. |
|
List specified/all Jobs in tabular output format. |
|
List specified/all Nodes in tabular output format. |
|
List specified/all Namespaces in a cluster (tabular output). |
|
List specified/all Pods in tabular output format. |
|
Get Pods by Label. Example: |
|
Get Pods by Namespace. Example: |
|
List specified/all PersistentVolumeClaims in tabular output format. |
|
List specified/all PersistentVolumeClaims and watch for changes. |
|
List specified/all Pods and watch for changes. |
|
List specified/all Deployments with additional columns of information. |
|
List specified/all ReplicaSets in tabular output format. |
|
List specified/all Services in tabular output format. |
|
List specified/all Secrets in tabular output format. |
|
List specified/all StatefulSets in tabular output format. |
|
List specified/all StatefulSets and watch for changes. |
|
List specified/all StatefulSets with additional columns of information. |
|
List specified/all Services and watch for changes. |
|
List specified/all Services with additional columns of information. |
|
Display the logs for a container or resource. |
|
Stream (follow) the logs for a container or resource. |
|
Forward one or more local ports to a Pod. |
|
Recreate all Pods in a Deployment with zero-downtime. |
|
Check the revisions of a Deployment. |
|
Check the rollout status of a Deployment. |
|
Check the rollout status of a StatefulSet. |
|
Rollback to the previous revision. |
|
Scale a Deployment. |
|
Scale a StatefulSet. |