KUBERNETES(1)(kubernetes)
π KUBERNETES(1)(kubernetes) π
hiii bestie πΈ welcome to the manual page for kubectl top pod, filed under KUBERNETES(1)(kubernetes) in the Manuals section, User subsection, and originally put together by Eric Paris, Jan 2015. this one's short and sweet, and it's about β¨metricsβ¨. let's get into it π«Ά
β¨ NAME β¨
kubectl top pod β display resource (CPU/memory) usage of pods π
π¦ SYNOPSIS π¦
kubectl top pod [OPTIONS]
that's it. that's the whole vibe check. π
π DESCRIPTION π
okay so basically: display resource (CPU/memory) usage of pods. that's the whole job, that's the main character energy right there π₯
the top pod command lets you peek at the resource consumption of pods. like, how much CPU and memory are these lil guys actually eating. very demure, very mindful, very observant of you. π
β οΈ real talk tho: due to the metrics pipeline delay, the numbers may be unavailable for a few minutes since pod creation. so if your brand new pod shows up with nothing, don't panic, it's not ghosting you, it's just β¨cookingβ¨. give it a minute π
π OPTIONS π
-A,--all-namespaces=falseβ if present, list the requested object(s) across all namespaces. the namespace in your current context gets ignored, even if you specified it with--namespace. she does not care about your context, she's looking at everything π--containers=falseβ if present, print usage of the containers within a pod. zoom in, get the receipts per container π§--field-selector=""β selector (field query) to filter on. supports=,==, and!=. (e.g.--field-selector key1=value1,key2=value2). heads up: the server only supports a limited number of field queries per type, so don't get too wild with it π--no-headers=falseβ if present, print output without headers. just the raw data, no labels, no small talk π-l,--selector=""β selector (label query) to filter on. supports=,==,!=,in,notin. (e.g.-l key1=value1,key2=value2,key3 in (value3)). matching objects must satisfy all of the specified label constraints β no partial credit, it's all or nothing periodt π--show-swap=falseβ print pod resources related to swap memory. swap girlies rise up π--sort-by=""β if non-empty, sort the pods list using the specified field. the field can be either'cpu'or'memory'. that's the whole menu, pick one πΈ--sum=falseβ print the sum of the resource usage. math but make it cluster ops β¨--use-protocol-buffers=trueβ enables using protocol-buffers to access the Metrics API. (yes, the default istrue, she's already doing it π)
π OPTIONS INHERITED FROM PARENT COMMANDS π
these are the ones that come down from the parent command, the family recipe, if you will π«Ά
--as=""β username to impersonate for the operation. user could be a regular user or a service account in a namespace. be someone else, lowkey iconic π--as-group=[]β group to impersonate for the operation. this flag can be repeated to specify multiple groups. stack 'em π--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key.--cache-dir="/home/username/.kube/cache"β default cache directory. that's literally the default path, character for character, don't come for me π--certificate-authority=""β path to a cert file for the certificate authority.--client-certificate=""β path to a client certificate file for TLS.--client-key=""β path to a client key file for TLS.--cluster=""β the name of the kubeconfig cluster to use.--context=""β the name of the kubeconfig context to use.--disable-compression=falseβ if true, opt-out of response compression for all requests to the server.--insecure-skip-tls-verify=falseβ if true, the server's certificate will not be checked for validity. > β οΈ this will make your HTTPS connections insecure. like, genuinely insecure. proceed with your eyes open bestie, this is not a cute flex π--kubeconfig=""β path to the kubeconfig file to use for CLI requests.--kuberc=""β path to the kuberc file to use for preferences. this can be disabled by exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=off.--match-server-version=falseβ require server version to match client version. no mismatched energy allowed π-n,--namespace=""β if present, the namespace scope for this CLI request.--password=""β password for basic authentication to the API server.--profile="none"β name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace). seven options, pick your fighter β¨--profile-output="profile.pprof"β name of the file to write the profile to.--proxy-url=""β proxy URL to use for requests to the API server.--request-timeout="0"β the length of time to wait before giving up on a single server request. non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). a value of zero means don't timeout requests. zero = infinite patience, she'll wait forever π°οΈ-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. if it is not provided, the hostname used to contact the server is used.--token=""β bearer token for authentication to the API server.--user=""β the name of the kubeconfig user to use.--username=""β username for basic authentication to the API server.--version=falseβ--version,--version=rawprints version information and quits;--version=vX.Y.Z...sets the reported version.--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code. no chill mode, warnings are now crimes π¨
π EXAMPLE π
copy these, they're correct, character for character, i'm not playing π
# Show metrics for all pods in the default namespace
kubectl top pod
# Show metrics for all pods in the given namespace
kubectl top pod --namespace=NAMESPACE
# Show metrics for a given pod and its containers
kubectl top pod POD_NAME --containers
# Show metrics for the pods defined by label name=myLabel
kubectl top pod -l name=myLabel
look at you go, topping pods like a pro π
π SEE ALSO π
(the comma is in the original, i'm keeping the comma, i don't make the rules π )
π HISTORY π
January 2015, originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since! β that's literally what it says and honestly? love that for them, so real π
and that's the whole page bestie π¦ this was KUBERNETES(1)(kubernetes) from the Manuals section, User subsection β go check your pods' vibes, stay hydrated, and remember the metrics might need a few minutes to show up πβ¨
π¦ where this page comes from
- arch rolling: kubectl 1.37.2-1 Β· Apache-2.0
- fedora 43: kubernetes1.37-client 1.37.0-3.fc43
- fedora 43: kubernetes1.37-client 1.37.1-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-HP AND CC-BY-4.0 AND ISC AND MIT AND MPL-2.0
- fedora 44: kubernetes1.37-client 1.37.0-3.fc44
- fedora 44: kubernetes1.37-client 1.37.1-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-3-Clause-HP AND CC-BY-4.0 AND ISC AND MIT AND MPL-2.0
- nixpkgs unstable: kubectl 1.37.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms