karpenter

by kfirfer

Helm chartv0.33.2App 0.33.2

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 v0.33.2 \
  --set "serviceAccount.annotations.eks\.amazonaws\.com/role-arn=${KARPENTER_IAM_ROLE_ARN}" \
  --set settings.clusterName=${CLUSTER_NAME} \
  --set settings.interruptionQueue=${CLUSTER_NAME} \
  --wait

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.envlist[]Additional environment variables for the controller pod.
controller.envFromlist[]
controller.extraVolumeMountslist[]Additional volumeMounts for the controller pod.
controller.healthProbe.portint8081The container port to use for http health probe.
controller.image.digeststring"sha256:afa0d0fd5ac375859dc3d239ec992f197cdf01f6c8e3413e3845a43c2434621e"SHA256 digest of the controller image.
controller.image.repositorystring"public.ecr.aws/karpenter/controller"Repository path to the controller image.
controller.image.tagstring"v0.32.3"Tag of the controller image.
controller.metrics.portint8000The container port to use for metrics.
controller.resourcesobject{}Resources for the controller pod.
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"Default"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.
logConfigobject{"enabled":false,"errorOutputPaths":["stderr"],"logEncoding":"json","logLevel":{"controller":"info","global":"info","webhook":"error"},"outputPaths":["stdout"]}Log configuration (Deprecated: Logging configuration will be dropped by v1, use logLevel instead)
logConfig.enabledboolfalseWhether to enable provisioning and mounting the log ConfigMap
logConfig.errorOutputPathslist["stderr"]Log errorOutputPaths - defaults to stderr only
logConfig.logEncodingstring"json"Log encoding - defaults to json - must be one of 'json', 'console'
logConfig.logLevelobject{"controller":"info","global":"info","webhook":"error"}Component-based log configuration
logConfig.logLevel.controllerstring"info"Controller log level, defaults to 'info'
logConfig.logLevel.globalstring"info"Global log level, defaults to 'info'
logConfig.logLevel.webhookstring"error"Error log level, defaults to 'error'
logConfig.outputPathslist["stdout"]Log outputPaths - defaults to stdout only
logLevelstring"info"Global log level, defaults to 'info'
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.
priorityClassNamestring"system-cluster-critical"PriorityClass name for the pod.
replicasint2Number of replicas.
revisionHistoryLimitint10The number of old ReplicaSets to retain to allow rollback.
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{}Endpoint configuration for the ServiceMonitor.
settingsobject{"assumeRoleARN":"","assumeRoleDuration":"15m","batchIdleDuration":"1s","batchMaxDuration":"10s","clusterCABundle":"","clusterEndpoint":"","clusterName":"","featureGates":{"drift":true},"interruptionQueue":"","isolatedVPC":false,"reservedENIs":"0","vmMemoryOverheadPercent":0.075}Global Settings to configure Karpenter
settings.assumeRoleARNstring""Role to assume for calling AWS services.
settings.assumeRoleDurationstring"15m"Duration of assumed credentials in minutes. Default value is 15 minutes. Not used unless assumeRoleARN set.
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.featureGatesobject{"drift":true}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.driftbooltruedrift is in BETA and is enabled by default. Setting drift to false disables the drift disruption method to watch for drift between currently deployed nodes and the desired state of nodes set in nodepools and nodeclasses
settings.interruptionQueuestring""interruptionQueue is disabled if not specified. Enabling interruption handling may require additional permissions on the controller service account. Additional permissions are outlined in the docs.
settings.isolatedVPCboolfalseIf true then assume we can't reach AWS services which don't have a VPC endpoint This also has the effect of disabling look-ups to the AWS pricing endpoint
settings.reservedENIsstring"0"Reserved ENIs are not included in the calculations for max-pods or kube-reserved This is most often used in the VPC CNI custom networking setup https://docs.aws.amazon.com/eks/latest/userguide/cni-custom-network.html
settings.vmMemoryOverheadPercentfloat0.075The VM memory overhead as a percent that will be subtracted from the total memory for all instance types
strategyobject{"rollingUpdate":{"maxUnavailable":1}}Strategy for updating the pod.
terminationGracePeriodSecondsstringnilOverride the default termination grace period for the pod.
tolerationslist[{"key":"CriticalAddonsOnly","operator":"Exists"}]Tolerations to allow the pod to be scheduled to nodes with taints.
topologySpreadConstraintslist[{"maxSkew":1,"topologyKey":"topology.kubernetes.io/zone","whenUnsatisfiable":"ScheduleAnyway"}]Topology spread constraints to increase the controller resilience by distributing pods across the cluster zones. If an explicit label selector is not provided one will be created from the pod selector labels.
webhook.enabledboolfalseWhether to enable the webhooks and webhook permissions.
webhook.metrics.portint8001The container port to use for webhook metrics.
webhook.portint8443The container port to use for the webhook.

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 v0.33.2 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