import { Duration } from 'aws-cdk-lib'; import { Construct } from "constructs"; import { ClusterInfo } from '../../spi'; import { HelmAddOn, HelmAddOnUserProps } from '../helm-addon'; import { Ec2NodeClassSpec, NodePoolSpec } from "./types"; export * from "./types"; export * from './karpenter-v1'; /** * Configuration options for the add-on */ export interface KarpenterAddOnProps 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?: NodePoolSpec; /** * This is the top level spec for the AWS Karpenter Provider * It contains configuration necessary to launch instances in AWS. */ ec2NodeClassSpec?: Ec2NodeClassSpec; /** * Flag for enabling Karpenter's native interruption handling */ interruptionHandling?: boolean; installCRDs?: 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; } /** * Implementation of the Karpenter add-on. * @deprecated use KarpenterV1AddOn moving forward */ export declare class KarpenterAddOn extends HelmAddOn { readonly options: KarpenterAddOnProps; constructor(props?: KarpenterAddOnProps); 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 ensure right features are added as part of the configuration * for the right version of the add-on * @param clusterInfo * @param version version of the add-on * @param disruption disruption feature available with the Beta CRDs * @param consolidation consolidation setting available with the Alpha CRDs * @param ttlSecondsAfterEmpty ttlSecondsAfterEmpty setting * @param ttlSecondsUntilExpired ttlSecondsUntilExpired setting * @param ec2NodeClassSpec Node Class Spec * @param amiFamily AMI Family * @returns */ private versionFeatureChecksForError; /** * 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; /** * Helper function to check whether: * 1. Supported Karpenter versions are implemented, and * 2. Supported Kubernetes versions are deployed on the cluster to use Karpenter * It will reject the addon if the cluster uses deprecated Kubernetes version, and * Warn users about issues if incompatible Karpenter version is used for a particular cluster * given its Kubernetes version * @param karpenterVersion Karpenter version to be deployed * @param kubeVersion Cluster's Kubernetes version */ private isCompatible; }