1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-18 06:15:41 +02:00
tldr/pages/common/kubectl-get.md
2025-08-13 19:32:02 +00:00

954 B

kubectl get

Get Kubernetes objects and resources. More information: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get.

  • Get all namespaces in the current cluster:

kubectl get {{[ns|namespaces]}}

  • Get nodes in a specified namespace:

kubectl get {{[no|nodes]}} {{[-n|--namespace]}} {{namespace}}

  • Get pods in a specified namespace:

kubectl get {{[po|pods]}} {{[-n|--namespace]}} {{namespace}}

  • Get deployments in a specified namespace:

kubectl get {{[deploy|deployments]}} {{[-n|--namespace]}} {{namespace}}

  • Get services in a specified namespace:

kubectl get {{[svc|services]}} {{[-n|--namespace]}} {{namespace}}

  • Get other resources:

kubectl get {{persistentvolumeclaims|secret|...}}

  • Get all resources in all namespaces:

kubectl get all {{[-A|--all-namespaces]}}

  • Get Kubernetes objects defined in a YAML manifest file:

kubectl get {{[-f|--filename]}} {{path/to/manifest.yaml}}