How can you view the logs of a specific node in K8S?

To view the logs of a specific node, you can follow these steps:

  1. Firstly, use the command kubectl get nodes to obtain a list of all nodes in the cluster.
  2. Choose the node you want to view logs for, and use the command “kubectl describe node ” to see detailed information about that node.
  3. In the node’s detailed information, locate the value of the kubeletEndpoint field, which specifies the address and port number of the node’s kubelet service.
  4. “Using the kubelet service address and port obtained in the previous step, use the following command to retrieve the logs for that node:”
  5. Retrieve the logs from the Kubernetes node specified by using HTTPS for communication with the kubelet API and the specified kubelet port, optionally specifying the namespace as .
  6. The is the name of the node to view the logs from, and is the port number of the kubelet service. The –namespace parameter is optional; it can be specified if the desired namespace is not kube-system.
  7. To view the logs of a node named node-1, use the following command:
  8. Retrieve the logs of node-1 in the kube-system namespace using HTTPS and port 10250.
  9. Please note that the above command requires administrative privileges for the cluster.
bannerAds