What were you trying to accomplish?
We are trying to install Karpenter when deploying EKS cluster by running eksctl in a codebuild project created by AWS CDK
What happened?
We know that Karpenter can only be installed using Eksctl during first time cluster creation based on this issue and thats what we did. However, we got this error Error: failed to install Karpenter: failed to install Karpenter chart: failed to install chart: Kubernetes cluster unreachable: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
How to reproduce it?
create a codebuild project that runs eksctl create cluster -f cluster_config.yaml in its buildspec.yaml
If using a config file, include it here, removing any sensitive information!
-->
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: test-cluster
region: us-east-1
version: "1.31"
tags:
karpenter.sh/discovery: test-cluster
vpc:
id: ${VPC_ID}
subnets:
private:
us-east-1a: { id: subnet-abcd}
us-east-1b: { id: subnet-abcd}
iam:
withOIDC: true
iamIdentityMappings:
- arn: arn:aws:iam::1234:role/AWSReservedSSO_bla2
groups:
- system:masters
username: admin
noDuplicateARNs: true # prevents shadowing of ARNs
- arn: arn:aws:iam::1234:role/codebuild-role
groups:
- system:masters
username: codebuild-eks
karpenter:
version: "1.2.1" # Exact version must be provided
createServiceAccount: true # default is false
withSpotInterruptionQueue: true # adds all required policies and rules for supporting Spot Interruption Queue, default is false
managedNodeGroups:
- name: ng-1
labels: { role: workers }
instanceType: t3.medium
desiredCapacity: 2
minSize: 1
maxSize: 3
privateNetworking: true
Logs
Error: failed to install Karpenter: failed to install Karpenter chart: failed to install chart: Kubernetes cluster unreachable: exec plugin: invalid apiVersion "client.authentication.k8s.io/v1alpha1"
322
Anything else we need to know?
aws/codebuild/amazonlinux2-x86_64-standard:3.0
Versions
~ $ eksctl info
eksctl version: 0.203.0
kubectl version: v1.31.2-eks-94953ac
OS: linux