{"id":17102708,"url":"https://github.com/robertd/cdk-karpenter","last_synced_at":"2025-06-30T22:33:30.579Z","repository":{"id":38177408,"uuid":"448460079","full_name":"robertd/cdk-karpenter","owner":"robertd","description":"AWS CDK Construct for installing Karpenter on top of an EKS cluster.","archived":false,"fork":false,"pushed_at":"2024-09-02T00:56:10.000Z","size":770,"stargazers_count":15,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-25T08:07:11.200Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cdk-karpenter","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-01-16T04:50:44.000Z","updated_at":"2025-04-14T10:19:17.000Z","dependencies_parsed_at":"2023-12-22T03:20:43.577Z","dependency_job_id":"e1b9abf6-3a3a-4a57-a8f9-1c093afee3dc","html_url":"https://github.com/robertd/cdk-karpenter","commit_stats":{"total_commits":81,"total_committers":3,"mean_commits":27.0,"dds":"0.11111111111111116","last_synced_commit":"7428c41ebc6b5d717f366446d43e90a32ed3c52e"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/robertd/cdk-karpenter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertd%2Fcdk-karpenter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertd%2Fcdk-karpenter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertd%2Fcdk-karpenter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertd%2Fcdk-karpenter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertd","download_url":"https://codeload.github.com/robertd/cdk-karpenter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertd%2Fcdk-karpenter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262860896,"owners_count":23376118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T15:29:49.993Z","updated_at":"2025-06-30T22:33:30.304Z","avatar_url":"https://github.com/robertd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NPM version](https://badge.fury.io/js/cdk-karpenter.svg)](https://badge.fury.io/js/cdk-karpenter)\n\n# cdk-karpenter\n\nKarpenter simplifies Kubernetes infrastructure with the right nodes at the right time. It automatically launches just the right compute resources to handle your cluster's applications. It is designed to let you take full advantage of the cloud with fast and simple compute provisioning for Kubernetes clusters.\n\nMore info about Karpenter at: https://karpenter.sh\n\nKarpenter Best Practices: https://aws.github.io/aws-eks-best-practices/karpenter/\n\nKarpenter version: v0.27.5\n\nNotes: \n- Karpenter no longer supports Kubernetes v1.20, but now supports Kubernetes v1.25. This change is due to the v1 PDB API, which was introduced in K8s v1.20 and subsequent removal of the v1beta1 API in K8s v1.25.\n- Prior to v0.20.0, Karpenter would prioritize certain instance type categories absent of any requirements in the Provisioner. v0.20.0+ removes prioritizing these instance type categories (“m”, “c”, “r”, “a”, “t”, “i”) in code. Bare Metal and GPU instance types are still deprioritized and only used if no other instance types are compatible with the node requirements. This means that, now, you will need to explicitly define the instance types, sizes or categories you want to allow in your Provisioner; otherwise, it is possible that you receive more exotic instance types.\n- As of v0.16.0 changed the default replicas from 1 to 2. See: https://github.com/aws/karpenter/blob/main/website/content/en/v0.16.1/troubleshooting.md\n\nUpgrade Notes: https://karpenter.sh/v0.27.5/upgrade-guide/#released-upgrade-notes\n\n## Docs\n\n[API.md](./API.md)\n\n## Showcase\n\n```ts\nimport { InstanceClass, InstanceSize, InstanceType, EbsDeviceVolumeType, Vpc } from 'aws-cdk-lib/aws-ec2';\nimport { Cluster, KubernetesVersion, Nodegroup } from 'aws-cdk-lib/aws-eks';\nimport { KubectlV25Layer } from '@aws-cdk/lambda-layer-kubectl-v26';\nimport { Karpenter, AMIFamily } from \"cdk-karpenter\";\n\n...\n\nconst vpc = new Vpc(stack, 'Vpc', { natGateways: 1 });\n\nconst cluster = new Cluster(stack, 'eks', {\n  vpc,\n  version: KubernetesVersion.V1_26,\n  kubectlLayer: new KubectlV26Layer(stack, 'kubectl'),\n  defaultCapacity: 1,\n  defaultCapacityInstance: InstanceType.of(InstanceClass.T3A, InstanceSize.MEDIUM),\n});\n\nconst karpenter = new Karpenter(stack, 'karpenter', {\n  cluster,\n  vpc,\n});\n\n// default provisioner\nkarpenter.addProvisioner('default');\n// Note: Default provisioner has no cpu/mem limits, nor will cleanup provisioned resources. Use with caution!!!\n// see: https://karpenter.sh/v0.27.5/concepts/deprovisioning/\n\n// custom provisoner - kitchen sink\nkarpenter.addProvisioner('custom', {\n  requirements: {\n    archTypes: [ArchType.AMD64, ArchType.ARM64],\n    instanceTypes: [\n      InstanceType.of(InstanceClass.M5, InstanceSize.LARGE),\n      InstanceType.of(InstanceClass.M5A, InstanceSize.LARGE),\n      InstanceType.of(InstanceClass.M6G, InstanceSize.LARGE),\n    ],\n    restrictInstanceTypes: [\n      InstanceType.of(InstanceClass.G5, InstanceSize.LARGE),\n    ],\n  },\n  ttlSecondsAfterEmpty: Duration.hours(1),\n  ttlSecondsUntilExpired: Duration.days(90),\n  labels: {\n    billing: 'my-team',\n  },\n  taints: [\n    {\n      key: 'example.com/special-taint',\n      effect: 'NoSchedule',\n    },\n  ],\n  startupTaints: [\n    {\n      key: 'example.com/another-taint',\n      effect: 'NoSchedule',\n    },\n  ],\n  limits: {\n    cpu: '1',\n    mem: '1000Gi',\n  },\n  consolidation: false,\n  provider: {\n    amiFamily: AMIFamily.AL2,\n    amiSelector: {\n      'aws-ids': 'ami-123,ami-456',\n    },\n    tags: {\n      Foo: 'Bar',\n    },\n    blockDeviceMappings: [\n      {\n        deviceName: 'test',\n        ebs: {\n          encrypted: true,\n          deleteOnTermination: true,\n          volumeSize: '100Gib',\n          volumeType: EbsDeviceVolumeType.GP3,\n          iops: 5000,\n          throughput: 1000,\n          kmsKeyId: 'arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab',\n        },\n      },\n    ],\n  },\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertd%2Fcdk-karpenter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertd%2Fcdk-karpenter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertd%2Fcdk-karpenter/lists"}