mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
39 lines
851 B
Plaintext
39 lines
851 B
Plaintext
:_mod-docs-content-type: PROCEDURE
|
|
[id="gathering-kubelet-logs_{context}"]
|
|
= Gathering kubelet logs
|
|
|
|
.Procedure
|
|
|
|
* After the kubelet's log level verbosity is configured properly, you can gather logs by running the following commands:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc adm node-logs --role master -u kubelet
|
|
----
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc adm node-logs --role worker -u kubelet
|
|
----
|
|
+
|
|
Alternatively, inside the node, run the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ journalctl -b -f -u kubelet.service
|
|
----
|
|
|
|
* To collect master container logs, run the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ sudo tail -f /var/log/containers/*
|
|
----
|
|
|
|
* To directly gather the logs of all nodes, run the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
- for n in $(oc get node --no-headers | awk '{print $1}'); do oc adm node-logs $n | gzip > $n.log.gz; done
|
|
----
|