oomichi / try-kubernetes

11 stars 5 forks source link

Failed to join the k8s cluster by nodegroup on EKS #136

Closed oomichi closed 6 months ago

oomichi commented 6 months ago
$ aws eks describe-nodegroup --cluster-name <cluster-name> --nodegroup-name <nodegroup-name> --region us-west-1
...
        "health": {
            "issues": [
                {
                    "code": "NodeCreationFailure",
                    "message": "Instances failed to join the kubernetes cluster",
                    "resourceIds": [
                        "i-083ed8e952af0c3ca"
                    ]
                }
            ]
        },
oomichi commented 6 months ago

That seems due to internet access from the subnet.

https://stackoverflow.com/questions/64515585/aws-eks-nodegroup-create-failed-instances-failed-to-join-the-kubernetes-clust

oomichi commented 6 months ago

still facing another issue:

$ aws eks describe-nodegroup --cluster-name test-cluster --nodegroup-name eks_nodegroup --region us-west-1
..
            "issues": [
                {
                    "code": "Ec2SubnetInvalidConfiguration",
                    "message": "One or more Amazon EC2 Subnets of [subnet-09b27c33b015862ee] for node group eks_nodegroup does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip",
                    "resourceIds": [
                        "subnet-09b27c33b015862ee"
                    ]
                }
            ]
oomichi commented 6 months ago

https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_vpc_subnet_module.html#parameters

map_public: true

works for the above issue.