From 982e0d94ff8570dab1fc35c9493b39efb026e58c Mon Sep 17 00:00:00 2001 From: udhos Date: Thu, 14 Nov 2024 16:14:05 -0300 Subject: [PATCH 1/3] Chart value controller.containerName to set distinguishing container name. --- charts/karpenter/templates/deployment.yaml | 4 ++++ charts/karpenter/values.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 952976cab027..adf06cf0b0f2 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -57,7 +57,11 @@ spec: hostNetwork: true {{- end }} containers: + {{- if .Values.controller.containerName }} + - name: {{ .Values.controller.containerName }} + {{- else }} - name: controller + {{- end }} securityContext: runAsUser: 65532 runAsGroup: 65532 diff --git a/charts/karpenter/values.yaml b/charts/karpenter/values.yaml index c865a2e9bf13..2b56f22e34f8 100644 --- a/charts/karpenter/values.yaml +++ b/charts/karpenter/values.yaml @@ -100,6 +100,8 @@ extraVolumes: [] # expirationSeconds: 86400 # path: token controller: + # -- Distinguishing container name (containerName: karpenter-controller). + containerName: controller image: # -- Repository path to the controller image. repository: public.ecr.aws/karpenter/controller From 1b602d051f54592c0ee4adfd04483ef0e562679b Mon Sep 17 00:00:00 2001 From: udhos Date: Tue, 19 Nov 2024 01:30:38 -0300 Subject: [PATCH 2/3] Update chart README with controller.containerName. --- charts/karpenter/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/karpenter/README.md b/charts/karpenter/README.md index bab7f9dd2236..993cc08f6d86 100644 --- a/charts/karpenter/README.md +++ b/charts/karpenter/README.md @@ -44,6 +44,7 @@ cosign verify public.ecr.aws/karpenter/karpenter:1.0.0 \ | additionalClusterRoleRules | list | `[]` | Specifies additional rules for the core ClusterRole. | | additionalLabels | object | `{}` | Additional labels to add into metadata. | | affinity | object | `{"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.containerName | string | `"controller"` | Distinguishing container name (containerName: karpenter-controller). | | controller.env | list | `[]` | Additional environment variables for the controller pod. | | controller.envFrom | list | `[]` | | | controller.extraVolumeMounts | list | `[]` | Additional volumeMounts for the controller pod. | From 382ebe09b4d15c08376e1c5c7ef92b18ae148b75 Mon Sep 17 00:00:00 2001 From: udhos Date: Tue, 26 Nov 2024 00:51:44 -0300 Subject: [PATCH 3/3] Use default function for default containerName. --- charts/karpenter/templates/deployment.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 303151700298..7671f18daeda 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -57,11 +57,7 @@ spec: hostNetwork: true {{- end }} containers: - {{- if .Values.controller.containerName }} - - name: {{ .Values.controller.containerName }} - {{- else }} - - name: controller - {{- end }} + - name: {{ .Values.controller.containerName | default "controller" }} securityContext: runAsUser: 65532 runAsGroup: 65532