From a492617058f0ade35b7f653518e62203f6a1d50d Mon Sep 17 00:00:00 2001 From: Amanuel Engeda Date: Wed, 21 Aug 2024 12:40:17 -0700 Subject: [PATCH] Configure values to use the release namespace --- .../templates/karpenter.k8s.aws_ec2nodeclasses.yaml | 2 +- .../templates/karpenter.sh_nodeclaims.yaml | 2 +- .../templates/karpenter.sh_nodepools.yaml | 2 +- charts/karpenter-crd/values.yaml | 1 - charts/karpenter/templates/_helpers.tpl | 11 ----------- hack/mutation/conversion_webhooks_injection.sh | 6 +++--- 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml b/charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml index 1cd12095de75..932ad720939e 100644 --- a/charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml +++ b/charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml @@ -1303,7 +1303,7 @@ spec: clientConfig: service: name: {{ .Values.webhook.serviceName }} - namespace: {{ .Values.webhook.serviceNamespace }} + namespace: {{ .Release.Namespace }} port: {{ .Values.webhook.port }} {{- end }} diff --git a/charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml b/charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml index 4aef381296e4..cb5a487c4570 100644 --- a/charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml +++ b/charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml @@ -826,7 +826,7 @@ spec: clientConfig: service: name: {{ .Values.webhook.serviceName }} - namespace: {{ .Values.webhook.serviceNamespace }} + namespace: {{ .Release.Namespace }} port: {{ .Values.webhook.port }} {{- end }} diff --git a/charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml b/charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml index 6de83288ad0e..38ce78ab2eb5 100644 --- a/charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml +++ b/charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml @@ -1077,7 +1077,7 @@ spec: clientConfig: service: name: {{ .Values.webhook.serviceName }} - namespace: {{ .Values.webhook.serviceNamespace }} + namespace: {{ .Release.Namespace }} port: {{ .Values.webhook.port }} {{- end }} diff --git a/charts/karpenter-crd/values.yaml b/charts/karpenter-crd/values.yaml index f9c9ae3eabef..09be8f70a092 100644 --- a/charts/karpenter-crd/values.yaml +++ b/charts/karpenter-crd/values.yaml @@ -2,6 +2,5 @@ webhook: # -- Whether to enable the webhooks and webhook permissions. enabled: true serviceName: karpenter - serviceNamespace: kube-system # -- The container port to use for the webhook. port: 8443 \ No newline at end of file diff --git a/charts/karpenter/templates/_helpers.tpl b/charts/karpenter/templates/_helpers.tpl index 8c5ffeb059d3..701fab128153 100644 --- a/charts/karpenter/templates/_helpers.tpl +++ b/charts/karpenter/templates/_helpers.tpl @@ -75,17 +75,6 @@ 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/hack/mutation/conversion_webhooks_injection.sh b/hack/mutation/conversion_webhooks_injection.sh index 1a466499d041..65a3ab3c8503 100755 --- a/hack/mutation/conversion_webhooks_injection.sh +++ b/hack/mutation/conversion_webhooks_injection.sh @@ -18,7 +18,7 @@ echo "{{- if .Values.webhook.enabled }} clientConfig: service: name: {{ .Values.webhook.serviceName }} - namespace: {{ .Values.webhook.serviceNamespace }} + namespace: {{ .Release.Namespace }} port: {{ .Values.webhook.port }} {{- end }} " >> charts/karpenter-crd/templates/karpenter.sh_nodepools.yaml @@ -33,7 +33,7 @@ echo "{{- if .Values.webhook.enabled }} clientConfig: service: name: {{ .Values.webhook.serviceName }} - namespace: {{ .Values.webhook.serviceNamespace }} + namespace: {{ .Release.Namespace }} port: {{ .Values.webhook.port }} {{- end }} " >> charts/karpenter-crd/templates/karpenter.sh_nodeclaims.yaml @@ -48,7 +48,7 @@ echo "{{- if .Values.webhook.enabled }} clientConfig: service: name: {{ .Values.webhook.serviceName }} - namespace: {{ .Values.webhook.serviceNamespace }} + namespace: {{ .Release.Namespace }} port: {{ .Values.webhook.port }} {{- end }} " >> charts/karpenter-crd/templates/karpenter.k8s.aws_ec2nodeclasses.yaml \ No newline at end of file