From ffc09e4bd71d84de3920888b682bf8d85b779c2f Mon Sep 17 00:00:00 2001 From: Charlie McBride <33269602+charliedmcb@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:21:14 -0800 Subject: [PATCH] commit cleanup final settings references (#170) Co-authored-by: Charlie McBride --- charts/karpenter/templates/configmap.yaml | 13 ----------- charts/karpenter/templates/deployment.yaml | 21 ------------------ charts/karpenter/templates/role.yaml | 1 - designs/aks-node-bootstrap.md | 4 ++-- test/pkg/environment/common/expectations.go | 24 --------------------- 5 files changed, 2 insertions(+), 61 deletions(-) delete mode 100644 charts/karpenter/templates/configmap.yaml diff --git a/charts/karpenter/templates/configmap.yaml b/charts/karpenter/templates/configmap.yaml deleted file mode 100644 index d52c7b6fe..000000000 --- a/charts/karpenter/templates/configmap.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: karpenter-global-settings - namespace: {{ .Release.Namespace }} - labels: - {{- include "karpenter.labels" . | nindent 4 }} - {{- with .Values.additionalAnnotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -data: - {{- list .Values.settings "" | include "flattenSettings" | indent 2 }} diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 020f956f4..066497fbc 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -30,7 +30,6 @@ spec: {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} - checksum/settings: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -100,26 +99,6 @@ spec: containerName: controller divisor: "0" resource: limits.memory - {{- with .Values.settings.batchMaxDuration }} - - name: BATCH_MAX_DURATION - value: "{{ . }}" - {{- end }} - {{- with .Values.settings.batchIdleDuration }} - - name: BATCH_IDLE_DURATION - value: "{{ . }}" - {{- end }} - {{- with or .Values.settings.azure.clusterName .Values.settings.clusterName }} - - name: CLUSTER_NAME - value: "{{ . }}" - {{- end }} - {{- with or .Values.settings.azure.clusterEndpoint .Values.settings.clusterEndpoint }} - - name: CLUSTER_ENDPOINT - value: "{{ . }}" - {{- end }} - {{- with or .Values.settings.azure.vmMemoryOverheadPercent .Values.settings.vmMemoryOverheadPercent }} - - name: VM_MEMORY_OVERHEAD_PERCENT - value: "{{ . }}" - {{- end }} {{- with .Values.controller.env }} {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/karpenter/templates/role.yaml b/charts/karpenter/templates/role.yaml index 4bacb3862..c7011ffe1 100644 --- a/charts/karpenter/templates/role.yaml +++ b/charts/karpenter/templates/role.yaml @@ -26,7 +26,6 @@ rules: resources: ["configmaps"] verbs: ["update", "patch", "delete"] resourceNames: - - karpenter-global-settings - config-logging - apiGroups: ["coordination.k8s.io"] resources: ["leases"] diff --git a/designs/aks-node-bootstrap.md b/designs/aks-node-bootstrap.md index 49db6b012..e6758cc34 100644 --- a/designs/aks-node-bootstrap.md +++ b/designs/aks-node-bootstrap.md @@ -9,7 +9,7 @@ - [Karpenter configuration sources](#karpenter-configuration-sources) - [Hardcoded values](#hardcoded-values) - [Environment variables](#environment-variables) - - [Karpenter global settings](#karpenter-global-settings) + - [Karpenter global settings [OUTDATED]](#karpenter-global-settings) - [Provisioner CR spec](#provisioner-cr-spec) - [NodeTemplate CR spec](#nodetemplate-cr-spec) - [Auto-detected values](#auto-detected-values) @@ -79,7 +79,7 @@ Hardcoded values are used for parameters in one of the following categories: Environment variables are used for global parameters that are needed for bootstrap and already required to be set for other reasons, such as Subscription ID - needed for Azure SDK. -### Karpenter global settings +### Karpenter global settings [OUTDATED] Karpenter uses a ConfigMap with flexible structure for global settings. Part of this configuration is generic, and part is provider specific. See [Concepts/Settings/ConfigMap](https://karpenter.sh/preview/concepts/settings/#configmap) in Karpenter documentation for an overview. Note that this represents part of the external configuration surface / API, and should be treated accordingly. diff --git a/test/pkg/environment/common/expectations.go b/test/pkg/environment/common/expectations.go index a9293b6e5..6df719d76 100644 --- a/test/pkg/environment/common/expectations.go +++ b/test/pkg/environment/common/expectations.go @@ -169,30 +169,6 @@ func (env *Environment) ExpectSettingsRemoved(vars ...v1.EnvVar) { } } -// ExpectSettingsLegacy gets the karpenter-global-settings ConfigMap -func (env *Environment) ExpectSettingsLegacy() *v1.ConfigMap { - GinkgoHelper() - return env.ExpectConfigMapExists(types.NamespacedName{Namespace: "karpenter", Name: "karpenter-global-settings"}) -} - -// ExpectSettingsReplacedLegacy performs a full replace of the settings, replacing the existing data -// with the data passed through -func (env *Environment) ExpectSettingsReplacedLegacy(data ...map[string]string) { - GinkgoHelper() - if env.ExpectConfigMapDataReplaced(types.NamespacedName{Namespace: "karpenter", Name: "karpenter-global-settings"}, data...) { - env.EventuallyExpectKarpenterRestarted() - } -} - -// ExpectSettingsOverriddenLegacy overrides specific values specified through data. It only overrides -// or inserts the specific values specified and does not upsert any of the existing data -func (env *Environment) ExpectSettingsOverriddenLegacy(data ...map[string]string) { - GinkgoHelper() - if env.ExpectConfigMapDataOverridden(types.NamespacedName{Namespace: "karpenter", Name: "karpenter-global-settings"}, data...) { - env.EventuallyExpectKarpenterRestarted() - } -} - func (env *Environment) ExpectConfigMapExists(key types.NamespacedName) *v1.ConfigMap { GinkgoHelper() cm := &v1.ConfigMap{}