diff --git a/charts/karpenter/README.md b/charts/karpenter/README.md index 882f94b21c66..68f02bd816e7 100644 --- a/charts/karpenter/README.md +++ b/charts/karpenter/README.md @@ -72,6 +72,7 @@ cosign verify public.ecr.aws/karpenter/karpenter:0.37.0 \ | podDisruptionBudget.name | string | `"karpenter"` | | | podLabels | object | `{}` | Additional labels for the pod. | | podSecurityContext | object | `{"fsGroup":65532}` | SecurityContext for the pod. | +| postInstallHook.image | string | `public.ecr.aws/bitnami/kubectl:1.30` | The image to run the post-install hook. This minimally needs to have `kubectl` installed | | priorityClassName | string | `"system-cluster-critical"` | PriorityClass name for the pod. | | replicas | int | `2` | Number of replicas. | | revisionHistoryLimit | int | `10` | The number of old ReplicaSets to retain to allow rollback. | diff --git a/charts/karpenter/templates/_helpers.tpl b/charts/karpenter/templates/_helpers.tpl index 701fab128153..8c5ffeb059d3 100644 --- a/charts/karpenter/templates/_helpers.tpl +++ b/charts/karpenter/templates/_helpers.tpl @@ -75,6 +75,17 @@ Karpenter image to use {{- end }} {{- end }} +{{/* +Karpenter post-install hook image to use +*/}} +{{- define "karpenter.postInstallHook.image" -}} +{{- if .Values.postInstallHook.image.digest }} +{{- printf "%s:%s@%s" .Values.postInstallHook.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.postInstallHook.image.tag) .Values.postInstallHook.image.digest }} +{{- else }} +{{- printf "%s:%s" .Values.postInstallHook.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.postInstallHook.image.tag) }} +{{- end }} +{{- end }} + {{/* Get PodDisruptionBudget API Version */}} {{- define "karpenter.pdb.apiVersion" -}} diff --git a/charts/karpenter/templates/post-install-hook.yaml b/charts/karpenter/templates/post-install-hook.yaml index 4192f7f64dcf..b2fd22824b8d 100644 --- a/charts/karpenter/templates/post-install-hook.yaml +++ b/charts/karpenter/templates/post-install-hook.yaml @@ -23,7 +23,7 @@ spec: {{- end }} containers: - name: post-install-job - image: public.ecr.aws/bitnami/kubectl:1.30 + image: {{ include "karpenter.postInstallHook.image" . }} command: - /bin/sh - -c diff --git a/charts/karpenter/values.yaml b/charts/karpenter/values.yaml index f6d1462ab3f4..62f65a77d934 100644 --- a/charts/karpenter/values.yaml +++ b/charts/karpenter/values.yaml @@ -137,6 +137,14 @@ controller: healthProbe: # -- The container port to use for http health probe. port: 8081 +postInstallHook: + image: + # -- Repository path to the post-install hook. This minimally needs to have `kubectl` installed + repository: public.ecr.aws/bitnami/kubectl + # -- Tag of the post-install hook image. + tag: "1.30" + # -- SHA256 digest of the post-install hook image. + digest: sha256:13a2ad1bd37ce42ee2a6f1ab0d30595f42eb7fe4a90d6ec848550524104a1ed6 webhook: # -- Whether to enable the webhooks and webhook permissions. enabled: true