import { Duration } from "aws-cdk-lib"; import { Construct } from "constructs"; import { ClusterInfo } from "../../spi"; import { HelmAddOn, HelmAddOnUserProps } from "../helm-addon"; import { Ec2NodeClassV1Spec, NodePoolV1Spec } from "./types"; /** * Configuration options for the add-on */ export interface KarpenterV1AddOnProps extends HelmAddOnUserProps { /** * This is the top level nodepool specification. Nodepools launch nodes in response to pods that are unschedulable. * A single nodepool is capable of managing a diverse set of nodes. * Node properties are determined from a combination of nodepool and pod scheduling constraints. */ nodePoolSpec?: NodePoolV1Spec; /** * This is the top level spec for the AWS Karpenter Provider * It contains configuration necessary to launch instances in AWS. */ ec2NodeClassSpec?: Ec2NodeClassV1Spec; /** * Flag for enabling Karpenter's native interruption handling */ interruptionHandling?: boolean; /** * Timeout duration while installing karpenter helm chart using addHelmChart API */ helmChartTimeout?: Duration; /** * Use Pod Identity. * To use EKS Pod Identities * - The cluster must have Kubernetes version 1.24 or later * - Karpenter Pods must be assigned to Linux Amazon EC2 instances * - Karpenter version supports Pod Identity (v0.35.0 or later) see https://docs.aws.amazon.com/eks/latest/userguide/pod-identity.html * * @see https://docs.aws.amazon.com/eks/latest/userguide/pod-identity.html * * @default false */ podIdentity?: boolean; /** * Flag for deploying the karpenter-crd Helm chart to manage CRD lifecycle. * When true, the official karpenter-crd chart is deployed before the main karpenter chart, * ensuring CRDs are updated on every upgrade — not just on initial install. * * @default true */ installCRDs?: boolean; /** * Repository URL for the karpenter-crd Helm chart. * Override this when mirroring charts to a private registry. * * @default "oci://public.ecr.aws/karpenter/karpenter-crd" */ crdRepository?: string; } /** * Implementation of the Karpenter add-on */ export declare class KarpenterV1AddOn extends HelmAddOn { readonly options: KarpenterV1AddOnProps; constructor(props?: KarpenterV1AddOnProps); deploy(clusterInfo: ClusterInfo): Promise; /** * Helper function to convert a key-pair values (with an operator) * of spec configurations to appropriate json format for addManifest function * @param reqs * @returns newReqs * */ protected convert(reqs: { key: string; operator: string; values: string[]; }[]): any[]; /** * Helper function to set up the Karpenter Node Role and Instance Profile * Outputs to CloudFormation and map the role to the aws-auth ConfigMap * @param cluster EKS Cluster * @param stackName Name of the stack * @param region Region of the stack * @returns [karpenterNodeRole, karpenterInstanceProfile] */ private setUpNodeRole; private createInterruptionQueue; }