DEV Community

Josh
Josh

Posted on

[EKS] Troubleshooting EKS worker node not join to the cluster

Today, we are talking about EKS cluster and related issue about EKS worker nodes.
Alt Text

After creating the EKS cluster and worker, we are excited to see our worker nodes status by kubectl get node. However, you may see No resources found return by the command:
Screen Shot 2021-09-17 at 12.25.56 AM

AWS premium support blog has a great article which discuss each part you need to check to see if there is anything wrong:

https://aws.amazon.com/premiumsupport/knowledge-center/eks-worker-nodes-cluster/

Instead of issuing a support ticket to AWS Support, we can troubleshoot the issue by ourselves. There is a log collector called EKS Logs Collector open sourced in EKS AMI repo. If you are using EKS optimized Amazon Linux 2 AMI or Windows, we can use this log collector to collect necessary logs from EKS worker nodes to identify the root cause of the issue.

The steps to collect logs :

  1. ssh into the worker node
  2. Run this project as the root user:
$ curl -O https://raw.githubusercontent.com/awslabs/amazon-eks-ami/master/log-collector-script/linux/eks-log-collector.sh
$ sudo bash eks-log-collector.sh 
Enter fullscreen mode Exit fullscreen mode

Screen Shot 2021-09-17 at 12.29.47 AM

Use tar zxvf /var/log/eks_i-0670341186c49aa57_2021-09-16_1629-UTC_0.6.2.tar.gz to uncompress the file
Screen Shot 2021-09-17 at 1.32.08 PM

We may find more information when check the kubelet.log

[ec2-user@ip-192-168-52-78 ~]$ ls
cni  containerd  docker  eks-log-collector.sh  ipamd  kernel  kubelet  networking  sandbox-image  storage  sysctls  system  var_log
[ec2-user@ip-192-168-52-78 ~]$ cd kubelet/
[ec2-user@ip-192-168-52-78 kubelet]$ ls
kubeconfig.yaml  kubelet.log  kubelet_service.txt
Enter fullscreen mode Exit fullscreen mode

Next part, I would show you what you would see when encounter each issue in kubelet.log

Need more time to finish this article :)

Top comments (0)