Skip to content

EKS node creation failed

0

I created cluster in EKS using console. I can connect to control plane using kubectl. But node group fail to create. It said instance cannot join cluster error. I create IAM role from console recommendation and even put worker node in public subnet but all still fail. I use system automation run book to troubleshoot worker node. Everything is passed except for this The UserData of the worker node must contain the bootstrap script with correct EKS cluster name. Please review this URL for further details: https://aws.amazon.com/premiumsupport/knowledge-center/eks-worker-nodes-cluster/

asked 2 years ago1.1K views

1 Answer
1

It appears that the main issue preventing your EKS worker nodes from joining the cluster is related to the UserData configuration. The bootstrap script in the UserData of the worker node must contain the correct EKS cluster name. This is a critical step in the node joining process.

To resolve this issue, you should:

  1. Review the UserData configuration for your worker nodes. Ensure that the bootstrap script is present and correctly formatted.

  2. Verify that the EKS cluster name in the bootstrap script matches exactly with your actual cluster name.

  3. If you're using an AWS CloudFormation template to create your nodes, double-check that the template is not using an outdated or incorrect bootstrap script.

  4. Make sure you're using a supported Amazon EKS-optimized AMI for your worker nodes. The AMI should be compatible with your cluster version.

  5. If you're manually configuring the UserData, ensure it includes the necessary commands to join the cluster, such as:

    #!/bin/bash
    /etc/eks/bootstrap.sh your-cluster-name
    

    Replace "your-cluster-name" with your actual EKS cluster name.

  6. If you're using a managed node group, check the node group configuration in the EKS console or via AWS CLI to ensure the correct cluster name is specified.

  7. After making these changes, try to recreate the node group.

If the issue persists after verifying the UserData and bootstrap script, you may want to check other potential causes:

  • Ensure that the VPC where the node is created has the correct DHCP options set, including domain-name and domain-name-servers.
  • Verify that the AWS STS endpoint for your region is enabled for your account.
  • Check that the security groups allow necessary traffic between the nodes and the control plane.
  • Review the IAM role permissions to make sure they include all required policies for EKS worker nodes.

If you continue to face issues after these steps, consider collecting more detailed logs from the worker nodes and reviewing them for any specific error messages that might provide additional insights into the problem.

Sources
Troubleshoot problems with Amazon EKS clusters and nodes - Amazon EKS
EKS node registration error | AWS re:Post
EKS cluster update from 1.27 to 1.28 Worker Node Group doesn't not join the cluster | AWS re:Post

answered 2 years ago

EXPERT

reviewed 2 years ago

  • I log in to worker node and check log. It produce this Jan 15 08:40:15 ip-172-31-1-122.ap-northeast-1.compute.internal kubelet[2115]: Failed to contact API server when waiting for CSINode publishing: csinodes.storage.k8s.io "ip-172-31-1-122.ap-northeast-1.compute.internal" is forbidden: User "system:node:i-02a9e452a85a0958d" cannot get resource "csinodes" in API group "storage.k8s.io" at the cluster scope: can only access CSINode with the same name as the requesting node

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.