Skip to content

Latest commit

 

History

History
441 lines (267 loc) · 14.2 KB

API.md

File metadata and controls

441 lines (267 loc) · 14.2 KB

API Reference

Constructs

Karpenter

Initializers

import { Karpenter } from 'cdk-eks-karpenter'

new Karpenter(scope: Construct, id: string, props: KarpenterProps)
Name Type Description
scope constructs.Construct No description.
id string No description.
props KarpenterProps No description.

scopeRequired
  • Type: constructs.Construct

idRequired
  • Type: string

propsRequired

Methods

Name Description
toString Returns a string representation of this construct.
with Applies one or more mixins to this construct.
addEC2NodeClass addEC2NodeClass adds a EC2NodeClass to the Karpenter configuration.
addManagedPolicyToKarpenterRole addManagedPolicyToKarpenterRole adds Managed Policies To Karpenter Role.
addNodePool addNodePool adds a NodePool to the Karpenter configuration.
addNodeTemplate addNodeTemplate adds a node template manifest to the cluster.
addProvisioner addProvisioner adds a provisioner manifest to the cluster.

toString
public toString(): string

Returns a string representation of this construct.

with
public with(mixins: ...IMixin[]): IConstruct

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

mixinsRequired
  • Type: ...constructs.IMixin[]

The mixins to apply.


addEC2NodeClass
public addEC2NodeClass(id: string, ec2NodeClassSpec: {[ key: string ]: any}): {[ key: string ]: any}

addEC2NodeClass adds a EC2NodeClass to the Karpenter configuration.

idRequired
  • Type: string

must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.


ec2NodeClassSpecRequired
  • Type: {[ key: string ]: any}

spec of Karpenters EC2NodeClass API.


addManagedPolicyToKarpenterRole
public addManagedPolicyToKarpenterRole(managedPolicy: IManagedPolicy): void

addManagedPolicyToKarpenterRole adds Managed Policies To Karpenter Role.

managedPolicyRequired
  • Type: aws-cdk-lib.aws_iam.IManagedPolicy

iam managed policy to add to the karpenter role.


addNodePool
public addNodePool(id: string, nodePoolSpec: {[ key: string ]: any}): {[ key: string ]: any}

addNodePool adds a NodePool to the Karpenter configuration.

idRequired
  • Type: string

must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.


nodePoolSpecRequired
  • Type: {[ key: string ]: any}

spec of Karpenters NodePool API.


addNodeTemplate
public addNodeTemplate(id: string, nodeTemplateSpec: {[ key: string ]: any}): void

addNodeTemplate adds a node template manifest to the cluster.

Currently the node template spec parameter is relatively free form.

idRequired
  • Type: string

must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.


nodeTemplateSpecRequired
  • Type: {[ key: string ]: any}

spec of Karpenters Node Template object.


addProvisioner
public addProvisioner(id: string, provisionerSpec: {[ key: string ]: any}): void

addProvisioner adds a provisioner manifest to the cluster.

Currently the provisioner spec parameter is relatively free form.

idRequired
  • Type: string

must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.


provisionerSpecRequired
  • Type: {[ key: string ]: any}

spec of Karpenters Provisioner object.


Static Functions

Name Description
isConstruct Checks if x is a construct.

isConstruct
import { Karpenter } from 'cdk-eks-karpenter'

Karpenter.isConstruct(x: any)

Checks if x is a construct.

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

xRequired
  • Type: any

Any object.


Properties

Name Type Description
node constructs.Node The tree node.
cluster aws-cdk-lib.aws_eks.Cluster No description.
helmExtraValues any No description.
namespace string No description.
nodeRole aws-cdk-lib.aws_iam.Role No description.
serviceAccountName string No description.
version string No description.
helmChartValues {[ key: string ]: any} No description.

nodeRequired
public readonly node: Node;
  • Type: constructs.Node

The tree node.


clusterRequired
public readonly cluster: Cluster;
  • Type: aws-cdk-lib.aws_eks.Cluster

helmExtraValuesRequired
public readonly helmExtraValues: any;
  • Type: any

namespaceRequired
public readonly namespace: string;
  • Type: string

nodeRoleRequired
public readonly nodeRole: Role;
  • Type: aws-cdk-lib.aws_iam.Role

serviceAccountNameRequired
public readonly serviceAccountName: string;
  • Type: string

versionRequired
public readonly version: string;
  • Type: string

helmChartValuesRequired
public readonly helmChartValues: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Structs

KarpenterProps

Initializer

import { KarpenterProps } from 'cdk-eks-karpenter'

const karpenterProps: KarpenterProps = { ... }

Properties

Name Type Description
cluster aws-cdk-lib.aws_eks.Cluster The EKS Cluster to attach to.
version string The helm chart version to install.
helmExtraValues {[ key: string ]: any} Extra values to pass to the Karpenter Helm chart.
namespace string The Kubernetes namespace to install to.
nodeRole aws-cdk-lib.aws_iam.Role Custom NodeRole to pass for Karpenter Nodes.
serviceAccountName string The Kubernetes ServiceAccount name to use.

clusterRequired
public readonly cluster: Cluster;
  • Type: aws-cdk-lib.aws_eks.Cluster

The EKS Cluster to attach to.


versionRequired
public readonly version: string;
  • Type: string
  • Default: latest

The helm chart version to install.


helmExtraValuesOptional
public readonly helmExtraValues: {[ key: string ]: any};
  • Type: {[ key: string ]: any}

Extra values to pass to the Karpenter Helm chart.


namespaceOptional
public readonly namespace: string;
  • Type: string
  • Default: karpenter

The Kubernetes namespace to install to.


nodeRoleOptional
public readonly nodeRole: Role;
  • Type: aws-cdk-lib.aws_iam.Role

Custom NodeRole to pass for Karpenter Nodes.


serviceAccountNameOptional
public readonly serviceAccountName: string;
  • Type: string
  • Default: karpenter

The Kubernetes ServiceAccount name to use.