HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

kubectl top — See the resource consumption for nodes or pods. More information: <https://kubernetes.io/docs/refere

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thekubectl topresourcecommandconsumptioncliforsee

Problem

How to use the kubectl top command: See the resource consumption for nodes or pods. More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_top/>.

Solution

kubectl top — See the resource consumption for nodes or pods. More information: <https://kubernetes.io/docs/reference/kubectl/generated/kubectl_top/>.

Get the resource consumption of all nodes:
kubectl top {{[no|nodes]}}


Get resource consumption of a specific node:
kubectl top {{[no|nodes]}} {{node_name}}


Get resource consumption of all pods:
kubectl top {{[po|pods]}}


Get resource consumption of a specific pod:
kubectl top {{[po|pods]}} {{pod_name}}


Get resource consumption of all pods in a namespace:
kubectl top {{[po|pods]}} {{[-n|--namespace]}} {{namespace_name}}


Get resource consumption of all containers in a pod:
kubectl top {{[po|pods]}} --containers


Get resource consumption of all pods with the specified label:
kubectl top {{[po|pods]}} {{[-l|--selector]}} {{key=value}}

Code Snippets

Get the resource consumption of all nodes

kubectl top {{[no|nodes]}}

Get resource consumption of a specific node

kubectl top {{[no|nodes]}} {{node_name}}

Get resource consumption of all pods

kubectl top {{[po|pods]}}

Get resource consumption of a specific pod

kubectl top {{[po|pods]}} {{pod_name}}

Get resource consumption of all pods in a namespace

kubectl top {{[po|pods]}} {{[-n|--namespace]}} {{namespace_name}}

Context

tldr-pages: common/kubectl top

Revisions (0)

No revisions yet.