cdk-eks-blueprints icon indicating copy to clipboard operation
cdk-eks-blueprints copied to clipboard

(addons/karpenter): Deployment fails due to missing CRD

Open flo-mair opened this issue 1 year ago • 4 comments

Describe the bug

The blueprint deployment fails due to missing CRD for NodePool:

Message returned: Error: b'error: resource mapping not found for name: "default-nodepool" namespace: "" from "/tmp/manifest.yaml": no matches for kind "NodePool" in version "karpenter.sh/v1beta1"\nensure CRDs are installed first\n'

Expected Behavior

Succesfull deployment

Current Behavior

Message returned: Error: b'error: resource mapping not found for name: "default-nodepool" namespace: "" from "/tmp/manifest.yaml": no matches for kind "NodePool" in version "karpenter.sh/v1beta1"\nensure CRDs are installed first\n'

Reproduction Steps

Deps:

"@aws-quickstart/eks-blueprints": "^1.14.0", "aws-cdk-lib": "2.133.0",

new blueprints.addons.KarpenterAddOn({
        version: 'v0.34.3',
        nodePoolSpec: {
            requirements: [
                {key: 'karpenter.k8s.aws/instance-category', operator: 'In', values: ['t']},
                {key: 'kubernetes.io/arch', operator: 'In', values: [ 'arm64']},
                {key: 'karpenter.sh/capacity-type', operator: 'In', values: ['spot']},
            ],
            disruption: {
                consolidationPolicy: 'WhenEmpty',
                consolidateAfter: '30s',
                expireAfter: '20m'
            }
        },
        ec2NodeClassSpec: {
            amiFamily: 'AL2',
            subnetSelectorTerms: [{tags: {'Name': `${stackName}/${stackName}-vpc/PrivateSubnet*`}}],
            securityGroupSelectorTerms: [{tags: {'aws:eks:cluster-name': clusterName}}],
        },
        interruptionHandling: true,
    })


Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.134.0

EKS Blueprints Version

1.14.1

Node.js Version

v18.17.0

Environment details (OS name and version, etc.)

macOS

Other information

No response

flo-mair avatar Mar 27 '24 12:03 flo-mair

@flo-mair making sure I understand - this is brand new cluster that you are provisioning and not an upgrade of an existing cluster, e.g. moving from lower versions of Karpenter to post 0.32?

shapirov103 avatar Mar 27 '24 14:03 shapirov103

yes this is a new cluster

flo-mair avatar Mar 27 '24 15:03 flo-mair

on a new cluster, the Karpenter helm chart should always be installing the CRDs on first install only. For subsequent installs, #962 will fix this (and as a workaround for this -- but what is the root cause here?)

jsamuel1 avatar Mar 27 '24 19:03 jsamuel1

@jsamuel1 i did several creates of a cluster and always ran into the same issue. Maybe its because I'm using K8s version 1.29? I also tried using blueprints v1.13.1

flo-mair avatar Apr 01 '24 15:04 flo-mair