tldr/pages/common/kubectl-get.md

33 lines
797 B
Markdown
Raw Normal View History

2020-10-05 16:08:22 +01: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 namespaces`
- Get nodes in a specified [n]amespace:
2020-10-05 16:08:22 +01:00
`kubectl get nodes --namespace {{namespace}}`
2020-10-05 16:08:22 +01:00
- Get pods in a specified [n]amespace:
2020-10-05 16:08:22 +01:00
`kubectl get pods --namespace {{namespace}}`
2020-10-05 16:08:22 +01:00
- Get deployments in a specified [n]amespace:
2020-10-05 16:08:22 +01:00
`kubectl get deployments --namespace {{namespace}}`
2020-10-05 16:08:22 +01:00
- Get services in a specified [n]amespace:
2020-10-05 16:08:22 +01:00
`kubectl get services --namespace {{namespace}}`
2020-10-05 16:08:22 +01:00
- Get all resources in a specified [n]amespace:
`kubectl get all --namespace {{namespace}}`
- Get Kubernetes objects defined in a YAML manifest [f]ile:
2020-10-05 16:08:22 +01:00
`kubectl get --file {{path/to/manifest.yaml}}`