karpenter

by stevehipwell

Helm chartv1.15.3App 1.15.3Verified publisher

A Helm chart for Karpenter, an open-source node provisioning project built for Kubernetes.

About this chart

karpenter

A Helm chart for Karpenter, an open-source node provisioning project built for Kubernetes.

Documentation

For full Karpenter documentation please checkout https://karpenter.sh.

Installing the Chart

You can follow the detailed installation instruction in the documentation which covers the Karpenter prerequisites and installation options. The outcome of these instructions should result in something like the following command.

helm upgrade --install --namespace karpenter --create-namespace \
  karpenter oci://public.ecr.aws/karpenter/karpenter \
  --version 1.14.1 \
  --set "serviceAccount.annotations.eks\.amazonaws\.com/role-arn=${KARPENTER_IAM_ROLE_ARN}" \
  --set settings.clusterName=${CLUSTER_NAME} \
  --set settings.interruptionQueue=${CLUSTER_NAME} \
  --wait

Verification

As the OCI Helm chart is signed by Cosign as part of the release process you can verify the chart before installing it by running the following command.

cosign verify public.ecr.aws/karpenter/karpenter:1.14.1 \
  --certificate-oidc-issuer=https://token.actions.githubusercontent.com \
  --certificate-identity-regexp='https://github\.com/aws/karpenter-provider-aws/\.github/workflows/release\.yaml@.+' \
  --certificate-github-workflow-repository=aws/karpenter-provider-aws \
  --certificate-github-workflow-name=Release \
  --certificate-github-workflow-ref=refs/tags/v1.14.1 \
  --annotations version=1.14.1

Values

KeyTypeDefaultDescription
additionalAnnotationsobject{}Additional annotations to add into metadata.
additionalClusterRoleRuleslist[]Specifies additional rules for the core ClusterRole.
additionalLabelsobject{}Additional labels to add into metadata.
affinityobject{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"karpenter.sh/nodepool","operator":"DoesNotExist"}]}]}},"podAntiAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":[{"topologyKey":"kubernetes.io/hostname"}]}}Affinity rules for scheduling the pod. If an explicit label selector is not provided for pod affinity or pod anti-affinity one will be created from the pod selector labels.
controller.containerNamestring"controller"Distinguishing container name (containerName: karpenter-controller).
controller.envlist[]Additional environment variables for the controller pod.
controller.envFromlist[]
controller.extraVolumeMountslist[]Additional volumeMounts for the controller container.
controller.healthProbe.portint8081The container port to use for http health probe.
controller.image.digeststring"sha256:723130949e4cab989461ff07d1be4cd781d63515432494641b33c235f300ae23"SHA256 digest of the controller image.
controller.image.repositorystring"public.ecr.aws/karpenter/controller"Repository path to the controller image.
controller.image.tagstring"1.14.1"Tag of the controller image.
controller.metrics.portint8080The container port to use for metrics.
controller.resourcesobject{}Resources for the controller container.
controller.securityContext.appArmorProfileobject{}AppArmor profile for the controller container.
controller.securityContext.seLinuxOptionsobject{}SELinux options for the controller container.
controller.securityContext.seccompProfileobject{}Seccomp profile for the controller container.
controller.sidecarContainerlist[]Additional sidecarContainer config
controller.sidecarVolumeMountslist[]Additional volumeMounts for the sidecar - this will be added to the volume mounts on top of extraVolumeMounts
dnsConfigobject{}Configure DNS Config for the pod
dnsPolicystring"ClusterFirst"Configure the DNS Policy for the pod
extraVolumeslist[]Additional volumes for the pod.
fullnameOverridestring""Overrides the chart's computed fullname.
hostNetworkboolfalseBind the pod to the host network. This is required when using a custom CNI.
imagePullPolicystring"IfNotPresent"Image pull policy for Docker images.
imagePullSecretslist[]Image pull secrets for Docker images.
initContainersobject{}add additional initContainers to run before karpenter container starts
logErrorOutputPathslist["stderr"]Log errorOutputPaths - defaults to stderr only
logLevelstring"info"Global log level, defaults to 'info'
logOutputPathslist["stdout"]Log outputPaths - defaults to stdout only
nameOverridestring""Overrides the chart's name.
nodeSelectorobject{"kubernetes.io/os":"linux"}Node selectors to schedule the pod to nodes with labels.
podAnnotationsobject{}Additional annotations for the pod.
podDisruptionBudget.maxUnavailableint1
podDisruptionBudget.namestring"karpenter"
podLabelsobject{}Additional labels for the pod.
podSecurityContextobject{"fsGroup":65532,"seccompProfile":{"type":"RuntimeDefault"}}SecurityContext for the pod.
priorityClassNamestring"system-cluster-critical"PriorityClass name for the pod.
replicasint2Number of replicas.
revisionHistoryLimitint10The number of old ReplicaSets to retain to allow rollback.
schedulerNamestring"default-scheduler"Specify which Kubernetes scheduler should dispatch the pod.
service.annotationsobject{}Additional annotations for the Service.
serviceAccount.annotationsobject{}Additional annotations for the ServiceAccount.
serviceAccount.createbooltrueSpecifies if a ServiceAccount should be created.
serviceAccount.namestring""The name of the ServiceAccount to use. If not set and create is true, a name is generated using the fullname template.
serviceMonitor.additionalLabelsobject{}Additional labels for the ServiceMonitor.
serviceMonitor.enabledboolfalseSpecifies whether a ServiceMonitor should be created.
serviceMonitor.endpointConfigobject{}Configuration on http-metrics endpoint for the ServiceMonitor. Not to be used to add additional endpoints. See the Prometheus operator documentation for configurable fields https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api-reference/api.md#endpoint
serviceMonitor.metricRelabelingslist[]Metric relabelings for the http-metrics endpoint on the ServiceMonitor. For more details on metric relabelings, see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#metric_relabel_configs
serviceMonitor.relabelingslist[]Relabelings for the http-metrics endpoint on the ServiceMonitor. For more details on relabelings, see: https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config
serviceMonitor.sampleLimitstringnilSpecifies the sampleLimit for prometheus scrapes. Per-scrape limit on the number of scraped samples that will be accepted. If more than this number of samples are present after metric relabeling the entire scrape will be treated as failed. 0 means no limit.
settingsobject{"amiRefreshInterval":"1m","awsFeatureGates":{"draEFA":null,"draNVIDIAGPU":null,"nodeClassCEL":false,"rebootForRepair":false},"batchIdleDuration":"1s","batchMaxDuration":"10s","clusterCABundle":"","clusterEndpoint":"","clusterName":"","disableClusterStateObservability":false,"disableDryRun":false,"eksControlPlane":false,"enableDRA":false,"enableZonalShift":false,"featureGates":{"capacityBuffer":false,"nodeOverlay":false,"nodeRepair":false,"podDeletionCostManagement":false,"reservedCapacity":true,"spotToSpotConsolidation":false,"staticCapacity":false,"terminateFirstDrift":false,"terminateFirstRepair":false},"ignoreDRARequests":null,"interruptionQueue":"","isolatedVPC":false,"legacyNodeRepair":false,"minValuesPolicy":"Strict","preferencePolicy":"Respect","reservedENIs":"0","securityGroupRefreshInterval":"1m","subnetRefreshInterval":"1m","vmMemoryOverheadPercent":0.075}Global Settings to configure Karpenter
settings.amiRefreshIntervalstring"1m"How often Karpenter refreshes AMI data from EC2. Increasing this value will reduce the number of DescribeImages API calls at the cost of increased staleness in AMI discovery and drift detection. Must be at least 1m.
settings.awsFeatureGatesobject{"draEFA":null,"draNVIDIAGPU":null,"nodeClassCEL":false,"rebootForRepair":false}AWS-specific Feature Gate configuration values.
settings.awsFeatureGates.draEFAboolfalsedraEFA is ALPHA and is disabled by default. Setting this to true will make Karpenter calculate the DRA devices the dranet driver publishes for EFA interfaces, so it can account for dra.net claims when it sizes new nodes. Can't be combined with settings.enableDRA.
settings.awsFeatureGates.draNVIDIAGPUboolfalsedraNVIDIAGPU is ALPHA and is disabled by default. Setting this to true will make Karpenter calculate the DRA devices the NVIDIA GPU driver publishes, so it can account for gpu.nvidia.com claims when it sizes new nodes. Can't be combined with settings.enableDRA.
settings.awsFeatureGates.nodeClassCELboolfalsenodeClassCEL is ALPHA and is disabled by default. Setting this to true will enable CEL validation on EC2NodeClass resources.
settings.awsFeatureGates.rebootForRepairboolfalserebootForRepair is ALPHA and is disabled by default. It has no effect without the nodeRepair feature gate. Setting this to true will make node repair reboot a node in place for reboot-clearable GPU faults instead of replacing it. Requires the ec2:RebootInstances permission.
settings.batchIdleDurationstring"1s"The maximum amount of time with no new ending pods that if exceeded ends the current batching window. If pods arrive faster than this time, the batching window will be extended up to the maxDuration. If they arrive slower, the pods will be batched separately.
settings.batchMaxDurationstring"10s"The maximum length of a batch window. The longer this is, the more pods we can consider for provisioning at one time which usually results in fewer but larger nodes.
settings.clusterCABundlestring""Cluster CA bundle for TLS configuration of provisioned nodes. If not set, this is taken from the controller's TLS configuration for the API server.
settings.clusterEndpointstring""Cluster endpoint. If not set, will be discovered during startup (EKS only).
settings.clusterNamestring""Cluster name.
settings.disableClusterStateObservabilityboolfalseDisable cluster state metrics and events.
settings.disableDryRunboolfalseDisable dry run validation for EC2NodeClasses.
settings.eksControlPlaneboolfalseMarking this true means that your cluster is running with an EKS control plane and Karpenter should attempt to discover cluster details from the DescribeCluster API.
settings.enableDRAboolfalseenableDRA is ALPHA and is disabled by default. Setting this to true will enable every AWS DRA driver feature gate (awsFeatureGates.draNVIDIAGPU and awsFeatureGates.draEFA) and set ignoreDRARequests to false. It can't be combined with any of those values.
settings.enableZonalShiftboolfalseMarking this true signals Karpenter to respect zonal shifts when making node claims. More information about Zonal Shift here: https://docs.aws.amazon.com/eks/latest/userguide/zone-shift-enable.html#zone-shift-enable-steps
settings.featureGatesobject{"capacityBuffer":false,"nodeOverlay":false,"nodeRepair":false,"podDeletionCostManagement":false,"reservedCapacity":true,"spotToSpotConsolidation":false,"staticCapacity":false,"terminateFirstDrift":false,"terminateFirstRepair":false}Feature Gate configuration values. Feature Gates will follow the same graduation process and requirements as feature gates in Kubernetes. More information here https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/#feature-gates-for-alpha-or-beta-features.
settings.featureGates.capacityBufferboolfalsecapacityBuffer is ALPHA and is disabled by default. Setting this to true will enable CapacityBuffer support for pre-provisioning spare capacity.
settings.featureGates.nodeOverlayboolfalsenodeOverlay is ALPHA and is disabled by default. Setting this will allow the use of node overlay to impact scheduling decisions
settings.featureGates.nodeRepairboolfalsenodeRepair is ALPHA and is disabled by default. Setting this to true will enable node repair.
settings.featureGates.podDeletionCostManagementboolfalsepodDeletionCostManagement is ALPHA and is disabled by default. Setting this to true will enable Karpenter to manage pod-deletion-cost annotations on ReplicaSet pods on its nodes, so that ReplicaSet scale-down prefers to remove pods from nodes Karpenter wants to consolidate.
settings.featureGates.reservedCapacitybooltruereservedCapacity is BETA and is enabled by default. Setting this will enable native on-demand capacity reservation support.
settings.

Deploy karpenter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has karpenter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkarpenter is pinned at v1.15.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply