OC-ADM-NODE-LOGS(1)

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

πŸ’… oc adm node-logs β€” the OC ADM(1) manual, but make it make sense πŸŽ€

okay so bestie, welcome to oc adm node-logs from the OC ADM(1) manual β€” the glow-up edition. Grab a strawberry drink πŸ“ and let's get into it, because this one is literally about peeking at what your nodes are saying behind your back. πŸ‘€


✨ NAME ✨

oc adm node-logs β€” display and filter node logs, periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

oc adm node-logs [OPTIONS]

🌸 DESCRIPTION 🌸

Display and filter node logs. That's the whole vibe. 🫢

This command retrieves logs for the node. The default mode is to query the systemd journal on supported operating systems, which allows searching, time based filtering, and unit based filtering. You may also use the --path argument to see a list of log files available under /var/log/ and view those contents directly. Two whole ways to snoop, iconique. ✨

⚠️ bestie, real talk: node logs may contain sensitive output and so are limited to privileged node administrators. The system:node-admins role grants this permission by default. No cap, don't go handing this out like candy. πŸ™ˆ

You check who has that permission via:

oc adm policy who-can --all-namespaces get nodes/log

πŸ’– OPTIONS πŸ’–

  • --boot=0 β€” show messages from a specific boot. Use negative numbers, allowed [-100, 0], passing invalid boot offset will fail retrieving logs. Only applies to node service logs. πŸ₯Ύ
  • --case-sensitive=true β€” filters are case sensitive by default. Pass --case-sensitive=false to do a case insensitive filter. your uppercase era πŸ’€
  • -g, --grep="" β€” filter log entries by the provided regex pattern. Only applies to node service logs. regex girlies rise 🧚
  • -o, --output="" β€” display service logs in an alternate format (short, cat, json, short-unix). Only applies to node service logs. pick your aesthetic ✨
  • --path="journal" β€” retrieve the specified path within the node's /var/log/ folder. The 'journal' value will allow querying the services on supported operating systems. πŸ“
  • --raw=false β€” perform no transformation of the returned data. raw and unfiltered, main character energy πŸ”₯
  • --role="" β€” set a label selector by node role. πŸ‘‘
  • -l, --selector="" β€” selector (label query) to filter on. 🎯
  • --since="" β€” return logs after a specific ISO timestamp or relative date. Only applies to node service logs. ⏰
  • --tail=0 β€” return up to this many lines (not more than 100k) from the end of the log. Only applies to node service logs. not me reading the last 100k lines like a novel 😭
  • --unify=false β€” interleave logs by sorting the output. Defaults on when viewing node service logs. πŸŒ€
  • -u, --unit=[] β€” return log entries from the specified services(s) Only applies to node service logs. (yes, "service(s)" β€” that's their typo, not mine, i'm just the messenger πŸŽ€)
  • --until="" β€” return logs before a specific ISO timestamp or relative date. Only applies to node service logs. ⏳

πŸŽ€ OPTIONS INHERITED FROM PARENT COMMANDS πŸŽ€

these are the family heirlooms, passed down from the parent command. lowkey iconic. πŸ’œ

  • --as="" β€” username to impersonate for the operation. User could be a regular user or a service account in a namespace. 🎭
  • --as-group=[] β€” group to impersonate for the operation, this flag can be repeated to specify multiple groups. πŸ‘―
  • --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="/homeless-shelter/.kube/cache" β€” default cache directory. 🏠
  • --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. 🚨 bestie this is a jump-scare, do not casually enable it. πŸ™ˆ
  • --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 exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off. πŸŽ›οΈ
  • --match-server-version=false β€” require server version to match client version. 🀝
  • -n, --namespace="" β€” if present, the namespace scope for this CLI request. πŸ“
  • --profile="none" β€” name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex). πŸ“Έ
  • --profile-output="profile.pprof" β€” name of the file to write the profile to. πŸ’Ύ
  • --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. ⏱️
  • -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. πŸ™‹
  • --warnings-as-errors=false β€” treat warnings received from the server as errors and exit with a non-zero exit code. 😀

🌈 EXAMPLE 🌈

here's the part where it all clicks, fr fr:

# Show kubelet logs from all control plane nodes
oc adm node-logs --role master -u kubelet

# See what logs are available in control plane nodes in /var/log
oc adm node-logs --role master --path=/

# Display cron log file from all control plane nodes
oc adm node-logs --role master --path=cron

three examples, all ate, no crumbs. πŸ”₯


⭐ SEE ALSO ⭐

  • oc-adm(1) β€” go say hi to the parent. πŸ‘‹

πŸ¦‹ HISTORY πŸ¦‹

June 2016, ported from the Kubernetes man-doc generator. a true vintage moment, we love a throwback. πŸ•°οΈ


and that's the page, bestie! 🫢 this whole thing comes to you courtesy of the Openshift CLI User Manuals, June 2016 vintage, from the lovely people at Openshift β€” go forth and read your logs responsibly. πŸ’œβœ¨πŸŽ€

πŸ“¦ where this page comes from