OC-ADM-NODE-LOGS(1)
π 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=falseto 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 exportingKUBECTL_KUBERC=falsefeature gate or turning off the featureKUBERC=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
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms