OC-ADM-TOP-POD(1)

πŸ“¦
version 4.22.0 Β· 2 versions
, in nixpkgs unstable

πŸ’… OC ADM TOP POD β€” bestie edition ✨

okay so this is the oc adm top manual, specifically for the pod subcommand β€” it lives in the OpenShift CLI User Manuals, and honestly? iconic. it's from June 2016, ported from the Kubernetes man-doc generator, and we're gonna get into all of it. no cap.


🌸 NAME 🌸

oc adm top pod β€” display resource (CPU/memory) usage of pods. that's the whole vibe. we're checking how much CPU and memory your pods are eating, and it's giving observability main character energy. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

oc adm top pod [OPTIONS]

literally just that. add flags as needed, bestie. ✨


πŸŽ€ DESCRIPTION πŸŽ€

okay so oc adm top pod shows you the resource (CPU/memory) usage of pods. that's it, that's the pitch.

the top pod command is your bestie for seeing the resource consumption of pods. it's like a vibe check for your cluster, but for CPU and memory instead of outfits. πŸ”₯

⚠️ important heads-up: due to the metrics pipeline delay, metrics may be unavailable for a few minutes since pod creation. so if you just made a pod and top is acting brand new and showing nothing? that's why. give it a minute, it's not ghosting you, it's just buffering. 😭

✨ OPTIONS ✨

  • -A, --all-namespaces=false β€” if present, list the requested object(s) across all namespaces. the namespace in current context is ignored even if you specified it with --namespace. so basically: flag goes on, namespace filter gets left on read. πŸ’…
  • --containers=false β€” if present, print usage of containers within a pod. the pod-level usage is cute, but this is the behind-the-scenes tea for each container. 🫢
  • --field-selector="" β€” selector (field query) to filter on, supports =, ==, and !=. (e.g. --field-selector key1=value1,key2=value2). just know the server only supports a limited number of field queries per type, so don't go wild. 😌
  • --no-headers=false β€” if present, print output without headers. minimalism slay. no column titles, just the data. 🌈
  • -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 β€” it's giving "all conditions must be met" energy. 🎯
  • --show-swap=false β€” print pod resources related to swap memory. lowkey niche but if swap is your thing, this is your moment. πŸ’œ
  • --sort-by="" β€” if non-empty, sort pods list using specified field. the field can be either cpu or memory. so you can sort by who's the hungriest. πŸ”₯
  • --sum=false β€” print the sum of the resource usage. one big total instead of the whole list. math girlies rise. βž•
  • --use-protocol-buffers=true β€” enables using protocol-buffers to access Metrics API. defaults to true, and it's giving efficient communication energy. ✨

🧚 OPTIONS INHERITED FROM PARENT COMMANDS 🧚

these are the flags that came from the parent commands, and yes, we're covering every single one because bestie deserves the full picture. 🫢

  • --as="" β€” username to impersonate for the operation. user could be a regular user or a service account in a namespace. very undercover, very sneaky. πŸ™ˆ
  • --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. for when you need to be that specific user. πŸ’…
  • --as-user-extra=[] β€” user extras to impersonate for the operation. this flag can be repeated to specify multiple values for the same key. yes, repeatable. yes, extra. obviously. πŸ’–
  • --cache-dir="/homeless-shelter/.kube/cache" β€” default cache directory. that's the path, character for character. don't ask why it's called homeless-shelter, that's just where the build lived. 😭
  • --certificate-authority="" β€” path to a cert file for the certificate authority. TLS security said "let me verify." πŸ”’
  • --client-certificate="" β€” path to a client certificate file for TLS. another cert, another vibe. πŸŽ€
  • --client-key="" β€” path to a client key file for TLS. keep it safe, bestie. πŸ—οΈ
  • --cluster="" β€” the name of the kubeconfig cluster to use. pick your cluster like you pick your playlist. 🌈
  • --context="" β€” the name of the kubeconfig context to use. same energy, different setting. ✨
  • --disable-compression=false β€” if true, opt-out of response compression for all requests to the server. sometimes you just want the raw data, no zip. 🫢
  • --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, actually dangerous. do not do this casually, bestie, this is not a "slay" moment, this is a "security risk" moment. πŸ’€
  • --kubeconfig="" β€” path to the kubeconfig file to use for CLI requests. point the CLI at your config and let it cook. πŸ“
  • --kuberc="" β€” path to the kuberc file to use for preferences. this can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off. your RC file, your rules. πŸŽ€
  • --match-server-version=false β€” require server version to match client version. strict vibes only. πŸ‘‘
  • -n, --namespace="" β€” if present, the namespace scope for this CLI request. scope your request like you scope your feed. 🌸
  • --profile="none" β€” name of profile to capture. one of (none|cpu|heap|goroutine|threadcreate|block|mutex). that's the full list, don't invent new ones, bestie. 🧚
  • --profile-output="profile.pprof" β€” name of the file to write the profile to. default is profile.pprof, literally. πŸ’–
  • --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 = patience of a saint. 🌈
  • -s, --server="" β€” the address and port of the Kubernetes API server. where the magic happens. ✨
  • --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. default behavior is right there, no need to overthink. 🫢
  • --token="" β€” bearer token for authentication to the API server. keep it secret, keep it safe. 🀫
  • --user="" β€” the name of the kubeconfig user to use. who are you today? main character, obviously. πŸ’…
  • --warnings-as-errors=false β€” treat warnings received from the server as errors and exit with a non-zero exit code. zero tolerance policy activated. πŸ”₯

🌟 EXAMPLE 🌟

bestie, here are the examples β€” they're literally in the manual and we're keeping them exactly as they are. periodt. πŸ’…

# Show metrics for all pods in the default namespace
oc adm top pod

# Show metrics for all pods in the given namespace
oc adm top pod --namespace=NAMESPACE

# Show metrics for a given pod and its containers
oc adm top pod POD_NAME --containers

# Show metrics for the pods defined by label name=myLabel
oc adm top pod -l name=myLabel

πŸ‘€ SEE ALSO πŸ‘€

that's the one reference, and yes, we're keeping the trailing comma because that's what the original does. character for character, no fixing. πŸŽ€


πŸ“œ HISTORY πŸ“œ

June 2016 β€” ported from the Kubernetes man-doc generator. a whole era. the manual was born and it ate. ✨


okay so that's the whole page. this OpenShift CLI User Manuals entry is from June 2016, ported from the Kubernetes man-doc generator, and it's giving vintage-but-still-relevant energy. go check your pods' CPU and memory usage, bestie. slay. πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from