$ oc get nodes
Review cluster node health status, resource consumption statistics, and node logs. Additionally, query kubelet
status on individual nodes.
You have access to the cluster as a user with the cluster-admin
role.
You have installed the OpenShift CLI (oc
).
List the name, status, and role for all nodes in the cluster:
$ oc get nodes
Summarize CPU and memory usage for each node within the cluster:
$ oc adm top nodes
Summarize CPU and memory usage for a specific node:
$ oc adm top node my-node
You can review cluster node health status, resource consumption statistics, and node logs. Additionally, you can query kubelet
status on individual nodes.
You have access to the cluster as a user with the cluster-admin
role.
Your API service is still functional.
You have installed the OpenShift CLI (oc
).
The kubelet is managed using a systemd service on each node. Review the kubelet’s status by querying the kubelet
systemd service within a debug pod.
Start a debug pod for a node:
$ oc debug node/my-node
If you are running |
Set /host
as the root directory within the debug shell. The debug pod mounts the host’s root file system in /host
within the pod. By changing the root directory to /host
, you can run binaries contained in the host’s executable paths:
# chroot /host
OpenShift Container Platform 4.17 cluster nodes running Red Hat Enterprise Linux CoreOS (RHCOS) are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes by using SSH is not recommended. However, if the OpenShift Container Platform API is not available, or |
Check whether the kubelet
systemd service is active on the node:
# systemctl is-active kubelet
Output a more detailed kubelet.service
status summary:
# systemctl status kubelet
You can gather journald
unit logs and other logs within /var/log
on individual cluster nodes.
You have access to the cluster as a user with the cluster-admin
role.
You have installed the OpenShift CLI (oc
).
Your API service is still functional.
You have SSH access to your hosts.
Query kubelet
journald
unit logs from OpenShift Container Platform cluster nodes. The following example queries control plane nodes only:
$ oc adm node-logs --role=master -u kubelet (1)
1 | Replace kubelet as appropriate to query other unit logs. |
Collect logs from specific subdirectories under /var/log/
on cluster nodes.
Retrieve a list of logs contained within a /var/log/
subdirectory. The following example lists files in /var/log/openshift-apiserver/
on all control plane nodes:
$ oc adm node-logs --role=master --path=openshift-apiserver
Inspect a specific log within a /var/log/
subdirectory. The following example outputs /var/log/openshift-apiserver/audit.log
contents from all control plane nodes:
$ oc adm node-logs --role=master --path=openshift-apiserver/audit.log
If the API is not functional, review the logs on each node using SSH instead. The following example tails /var/log/openshift-apiserver/audit.log
:
$ ssh core@<master-node>.<cluster_name>.<base_domain> sudo tail -f /var/log/openshift-apiserver/audit.log
OpenShift Container Platform 4.17 cluster nodes running Red Hat Enterprise Linux CoreOS (RHCOS) are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes by using SSH is not recommended. Before attempting to collect diagnostic data over SSH, review whether the data collected by running |