Skip to content

Commit

Permalink
commit cleanup final settings references (#170)
Browse files Browse the repository at this point in the history
Co-authored-by: Charlie McBride <[email protected]>
  • Loading branch information
charliedmcb and Charlie McBride authored Mar 7, 2024
1 parent d019775 commit ffc09e4
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 61 deletions.
13 changes: 0 additions & 13 deletions charts/karpenter/templates/configmap.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions charts/karpenter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down
1 change: 0 additions & 1 deletion charts/karpenter/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ rules:
resources: ["configmaps"]
verbs: ["update", "patch", "delete"]
resourceNames:
- karpenter-global-settings
- config-logging
- apiGroups: ["coordination.k8s.io"]
resources: ["leases"]
Expand Down
4 changes: 2 additions & 2 deletions designs/aks-node-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.

Expand Down
24 changes: 0 additions & 24 deletions test/pkg/environment/common/expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit ffc09e4

Please sign in to comment.