apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: sandbox-pool
spec:
  template:
    spec:
      requirements:
        - key: node.kubernetes.io/instance-type
          operator: In
          values:
          {{- range .Compute.InstanceTypes }}
            - {{ . }}
          {{- end }}
        - key: karpenter.sh/capacity-type
          operator: In
          values:
          {{- range .Compute.CapacityTypes }}
            - {{ . }}
          {{- end }}
        - key: kubernetes.io/arch
          operator: In
          values:
            - amd64
      nodeClassRef:
        name: sandbox-nodes
        group: karpenter.k8s.aws
        kind: EC2NodeClass
  limits:
    cpu: {{ .Compute.MaxCPU }}
    memory: {{ .Compute.MaxMemory }}
  disruption:
    consolidationPolicy: {{ if .Compute.Consolidation }}WhenEmptyOrUnderutilized{{ else }}WhenEmpty{{ end }}
