Kubespec Logo kubespec.dev

karpenter.sh/v1

Cluster-scoped Resource

NodePool

        NodePool is the Schema for the NodePools API
      

Click on Property Name to show the description, and Pink Types to expand schema.

Required properties are marked with *

Change History

Karpenter v1.3.3

Karpenter v1.3.2

Karpenter v1.3.1

Karpenter v1.3.0

Karpenter v1.2.3

Karpenter v1.2.2

Karpenter v1.2.1

Karpenter v1.2.0

Karpenter v1.1.5

Karpenter v1.1.4

Karpenter v1.1.3

Karpenter v1.1.2

Karpenter v1.1.1

Karpenter v1.1.0

Karpenter v1.0.9

Karpenter v1.0.8

Karpenter v1.0.7

Karpenter v1.0.6

Karpenter v1.0.5

Karpenter v1.0.4

Karpenter v1.0.3

Karpenter v1.0.2

~2

Karpenter v1.0.1

Examples

There are 2 examples of NodePool that you can use as a starting point to create your own.

apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: default
spec:
  # Constrain the maximum size of the node pool
  limits:
    cpu: 256
    memory: 1024Gi
  disruption:
    # Allow Karpenter to consolidate nodes when they are empty or underutilized
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 5m
    budgets:
      # Allow voluntary disruptions to 5% of the nodes in the pool for any reason
      - nodes: "5%"
  template:
    spec:
      # Use the EC2NodeClass named "private" as the node template in this pool
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: private
      # Force node replacement after about a month
      expireAfter: 720h
      requirements:
        # Select from standard instance families (compute, general, memory)
        - key: karpenter.k8s.aws/instance-category
          operator: In
          values: ["c", "m", "r"]
        # Only choose instances greater than this generation
        - key: karpenter.k8s.aws/instance-generation
          operator: Gt
          values: ["2"]
        # Only use on-demand instances in this pool
        - key: karpenter.sh/capacity-type
          operator: In
          values: ["on-demand"]
        - key: kubernetes.io/arch
          operator: In
          # Allow AMD64 and ARM64 (e.g., Graviton) proceseors
          values: ["amd64", "arm64"]
        # Only use Linux as the OS in this pool
        - key: kubernetes.io/os
          operator: In
          values: ["linux"]

Other useful resources