- Newest
- Most votes
- Most comments
Fixed by adding the following Maven dependency:
<dependency>
<groupId>software.amazon.awscdk</groupId>
<artifactId>cdk-lambda-layer-kubectl-v32</artifactId>
<version>2.1.0</version>
</dependency>
and creating the EKS cluster:
Cluster cluster = Cluster.Builder.create(this, "MyCluster")
.version(KubernetesVersion.V1_28)
.vpc(vpc)
.kubectlLayer(new KubectlV32Layer(this, "KubectlLayer"))
.defaultCapacity(0)
.build();
answered a year ago
When deploying an EKS cluster using AWS CDK in the eu-west-3 region, you're encountering issues with missing kubectl Lambda layers. This is a common authentication problem when working with EKS and CDK.
The error you're seeing indicates that your CDK deployment is trying to access a kubectl Lambda layer from an external AWS account (903779448426), but it doesn't have the necessary permissions. This happens because the CDK uses Lambda functions with kubectl to interact with your EKS cluster during deployment.
For the eu-west-3 region, there is a Lambda layer available for AWS Lambda Powertools TypeScript at: arn:aws:lambda:eu-west-3:094274105915:layer:AWSLambdaPowertoolsTypeScriptV2:38
However, this is not the kubectl layer you need for EKS deployments.
To resolve this issue, you have a few options:
-
Create your own kubectl Lambda layer in your account for the eu-west-3 region.
-
Use the AWS CDK's
eks.KubectlLayerconstruct to create a custom kubectl layer in your account. -
If possible, deploy your EKS cluster in a region where the kubectl Lambda layers are available (like us-east-1).
-
Use the
skipKubectlLambdaLayeroption when creating your EKS cluster to avoid using the Lambda layer altogether, but this may limit some functionality.
When working with EKS clusters through CDK, ensure that:
- Your IAM user or role has the necessary permissions to access the EKS cluster
- You update your kubeconfig file properly to authenticate with your EKS cluster
- You're using the correct AWS CLI credentials
For troubleshooting EKS node join issues, verify that:
- DNS support is enabled for your VPC
- Worker nodes have the correct permissions
- Networking is properly configured for your VPC subnets
- The aws-auth ConfigMap includes the NodeInstanceRole of your worker nodes
- Security group requirements are met
Sources
Error while creating EKS cluster | AWS re:Post
Lambda layers - Powertools for AWS Lambda (TypeScript)
Troubleshoot EKS node join cluster errors | AWS re:Post
answered a year ago
This response isn't accurate.
- Create your own kubectl Lambda layer in your account for the eu-west-3 region. Complex to implement and maintain as it requires to package kubectl binary and dependencies.
- Use the AWS CDK's eks.KubectlLayer construct to create a custom kubectl layer in your account. Such a construct doesn't actually exist in CDK.
- If possible, deploy your EKS cluster in a region where the kubectl Lambda layers are available (like us-east-1). There is no kubectl Lambda layer in us-east-1 neither, as shown below:
aws lambda get-layer-version --layer-name arn:aws:lambda:us-east-1:903779448426:layer:kubectl-v1-28:1 --version-number 1 --region us-east-1
An error occurred (ValidationException) when calling the GetLayerVersion operation: 1 validation error detected: Value 'arn:aws:lambda:us-east-1:903779448426:layer:kubectl-v1-28:1' at 'layerName' failed to satisfy constraint: Member must satisfy regular expression pattern: (arn:(aws[a-zA-Z-]*)?:lambda:(eusc-)?[a-z]{2}((-gov)|(-iso([a-z]?)))?-[a-z]+-\d{1}:\d{12}:layer:[a-zA-Z0-9-_]+)|[a-zA-Z0-9-_]+
- Use the skipKubectlLambdaLayer option when creating your EKS cluster to avoid using the Lambda layer altogether, but this may limit some functionality. This option doesn't exist in the CDK Cluster builder. The Generative AI agent might be confusing different CDK versions or services
answered a year ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
