mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-07 04:26:01 +02:00
kubectl: add page (#1954)
This commit is contained in:
parent
c93f4b96f5
commit
3cb40d53bc
1 changed files with 31 additions and 0 deletions
31
pages/common/kubectl.md
Normal file
31
pages/common/kubectl.md
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# kubectl
|
||||||
|
|
||||||
|
> Command line interface for running commands against Kubernetes clusters.
|
||||||
|
|
||||||
|
- List all pods in all namespaces:
|
||||||
|
|
||||||
|
`kubectl get pods --all-namespaces`
|
||||||
|
|
||||||
|
- List all pods with more information (such as node name):
|
||||||
|
|
||||||
|
`kubectl get pods -o wide`
|
||||||
|
|
||||||
|
- Update specified pod with the label 'unhealthy' and the value 'true':
|
||||||
|
|
||||||
|
`kubectl label pods {{name}} unhealthy=true`
|
||||||
|
|
||||||
|
- List all resources with different types:
|
||||||
|
|
||||||
|
`kubectl get all`
|
||||||
|
|
||||||
|
- Show metrics for all nodes:
|
||||||
|
|
||||||
|
`kubectl top node`
|
||||||
|
|
||||||
|
- Show metrics for all pods in the default namespace:
|
||||||
|
|
||||||
|
`kubectl top pod`
|
||||||
|
|
||||||
|
- Print the address of the master and cluster services:
|
||||||
|
|
||||||
|
`kubectl cluster-info`
|
Loading…
Add table
Reference in a new issue