1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-08-17 23:35:41 +02:00
tldr/pages/common/kubectl-get.md

37 lines
954 B
Markdown
Raw Normal View History

2020-10-05 08:08:22 -07:00
# 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]}}`
2020-10-05 08:08:22 -07:00
- Get nodes in a specified namespace:
2020-10-05 08:08:22 -07:00
`kubectl get {{[no|nodes]}} {{[-n|--namespace]}} {{namespace}}`
2020-10-05 08:08:22 -07:00
- Get pods in a specified namespace:
2020-10-05 08:08:22 -07:00
`kubectl get {{[po|pods]}} {{[-n|--namespace]}} {{namespace}}`
2020-10-05 08:08:22 -07:00
- Get deployments in a specified namespace:
2020-10-05 08:08:22 -07:00
`kubectl get {{[deploy|deployments]}} {{[-n|--namespace]}} {{namespace}}`
2020-10-05 08:08:22 -07:00
- Get services in a specified namespace:
2020-10-05 08:08:22 -07:00
`kubectl get {{[svc|services]}} {{[-n|--namespace]}} {{namespace}}`
2020-10-05 08:08:22 -07:00
- Get other resources:
2025-08-13 22:32:02 +03:00
`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:
2020-10-05 08:08:22 -07:00
`kubectl get {{[-f|--filename]}} {{path/to/manifest.yaml}}`