diff --git a/charts/karpenter/templates/_helpers.tpl b/charts/karpenter/templates/_helpers.tpl index 212f599b12dc..85ae07283344 100644 --- a/charts/karpenter/templates/_helpers.tpl +++ b/charts/karpenter/templates/_helpers.tpl @@ -45,6 +45,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{- end }} + +{{/* +Container name +*/}} +{{- define "karpenter.controller.ContainerName" -}} +{{ .Values.controller.containerName | default "controller" }} +{{- end }} + {{/* Selector labels */}} diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 990ce486292e..a36edab14bea 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -60,7 +60,7 @@ spec: schedulerName: {{ . | quote }} {{- end }} containers: - - name: {{ .Values.controller.containerName | default "controller" }} + - name: {{ include "karpenter.controller.ContainerName" . }} securityContext: runAsUser: 65532 runAsGroup: 65532 @@ -102,7 +102,7 @@ spec: - name: MEMORY_LIMIT valueFrom: resourceFieldRef: - containerName: controller + containerName: {{ include "karpenter.controller.ContainerName" . }} divisor: "0" resource: limits.memory - name: FEATURE_GATES