diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/_helpers.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/_helpers.tpl index 7b054610e5..3f9b1ffb3a 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/_helpers.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/_helpers.tpl @@ -13,7 +13,7 @@ openstack {{- define "t8s-cluster.clusterClass.tlsCipherSuites" -}} {{- $cipherSuites := list "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305" "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305" "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" "TLS_RSA_WITH_AES_256_GCM_SHA384" "TLS_RSA_WITH_AES_128_GCM_SHA256" -}} - {{- $cipherSuites | toYaml -}} + {{- toYaml $cipherSuites -}} {{- end -}} {{- define "t8s-cluster.clusterClass.preKubeadmCommands" -}} @@ -82,7 +82,7 @@ server = {{ printf "https://%s" .registry | quote }} {{- $featureGates = set $featureGates $featureGate true -}} {{- end -}} {{- end -}} - {{- $featureGates | toYaml -}} + {{- toYaml $featureGates -}} {{- end -}} {{- define "t8s-cluster.clusterClass.containerdConfig.containerRegistryMirrorConfigs" -}} @@ -97,14 +97,14 @@ server = {{ printf "https://%s" .registry | quote }} "registry.k8s.io" "registry.opensource.zalan.do" "registry.teuto.io" - -}} + -}} {{- $mirroredRegistries := concat $defaultMirroredRegistries (.Values.containerRegistryMirror.additionallyMirroredRegistries | default list) | sortAlpha | uniq -}} {{- $files := list -}} {{- range $registry := $mirroredRegistries }} {{- $files = append $files (dict "content" (include "t8s-cluster.clusterClass.containerdConfig.containerRegistryMirrorConfigs.content" (dict "registry" $registry "endpoint" $.Values.containerRegistryMirror.mirrorEndpoint)) "path" (printf `/etc/containerd/registries.conf.d/%s/hosts.toml` $registry)) -}} {{- end }} {{- $files = append $files (dict "content" (include "t8s-cluster.clusterClass.containerdConfig.containerRegistryMirrorConfigs.content" (dict "registry" "registry-1.docker.io" "endpoint" $.Values.containerRegistryMirror.mirrorEndpoint)) "path" "/etc/containerd/registries.conf.d/docker.io/hosts.toml") -}} - {{- $files | toYaml -}} + {{- toYaml $files -}} {{- end -}} {{- define "t8s-cluster.clusterClass.configTemplate.files" -}} @@ -120,7 +120,7 @@ server = {{ printf "https://%s" .registry | quote }} {{- if .Values.global.injectedCertificateAuthorities }} {{- $files = append $files (dict "content" .Values.global.injectedCertificateAuthorities "path" "/usr/local/share/ca-certificates/injected-ca-certs.crt" ) -}} {{- end }} - {{- $files | toYaml -}} + {{- toYaml $files -}} {{- end -}} {{- define "t8s-cluster.clusterClass.args.base" -}} @@ -130,10 +130,12 @@ server = {{ printf "https://%s" .registry | quote }} {{- define "t8s-cluster.clusterClass.args.shared" -}} {{- $args := include "t8s-cluster.clusterClass.args.base" (dict) | fromYaml -}} {{- $args = mustMerge (dict - "authorization-always-allow-paths" (list "/healthz" "/readyz" "/livez" "/metrics" | join ",") - "bind-address" "0.0.0.0" - ) $args -}} - {{- $args | toYaml -}} + "authorization-always-allow-paths" (list "/healthz" "/readyz" "/livez" "/metrics" | join ",") + "bind-address" "0.0.0.0" + ) + $args + -}} + {{- toYaml $args -}} {{- end -}} {{- define "t8s-cluster.clusterClass.args.scheduler" -}} @@ -149,7 +151,7 @@ server = {{ printf "https://%s" .registry | quote }} {{- $args := include "t8s-cluster.clusterClass.args.shared" (dict) | fromYaml -}} {{- $args = mustMerge (include "t8s-cluster.clusterClass.args.sharedController" (dict "context" .context) | fromYaml) $args -}} {{- $args = set $args "terminated-pod-gc-threshold" "100" -}} - {{- $args | toYaml -}} + {{- toYaml $args -}} {{- end }} {{- define "t8s-cluster.clusterClass.apiServer.admissionPlugins" -}} @@ -157,7 +159,7 @@ server = {{ printf "https://%s" .registry | quote }} {{- if not .excludePatches -}} {{- $admissionPlugins = concat $admissionPlugins (list "EventRateLimit") -}} {{- end -}} - {{- $admissionPlugins | toYaml -}} + {{- toYaml $admissionPlugins -}} {{- end -}} {{- define "t8s-cluster.clusterClass.args.apiServer" -}} @@ -166,5 +168,5 @@ server = {{ printf "https://%s" .registry | quote }} {{- $args = set $args "enable-admission-plugins" (include "t8s-cluster.clusterClass.apiServer.admissionPlugins" (dict "excludePatches" .excludePatches) | fromYamlArray | join ",") -}} {{- $args = set $args "event-ttl" "4h" -}} {{- $args = set $args "tls-cipher-suites" (include "t8s-cluster.clusterClass.tlsCipherSuites" (dict) | fromYamlArray | join ",") -}} - {{- $args | toYaml -}} + {{- toYaml $args -}} {{- end }} diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_helpers.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_helpers.tpl index afc43df92d..51b65b60d2 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_helpers.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_helpers.tpl @@ -1,7 +1,5 @@ {{- define "t8s-cluster.clusterClass.k0smotronControlPlaneTemplate.specHash" -}} {{/* the full context is needed for .Files.Get */}} - {{- $inputs := (dict - "spec" (include "t8s-cluster.clusterClass.k0smotronControlPlaneTemplate.spec" $) - ) -}} + {{- $inputs := dict "spec" (include "t8s-cluster.clusterClass.k0smotronControlPlaneTemplate.spec" $) -}} {{- mustToJson $inputs | toString | quote | sha1sum | trunc 8 -}} {{- end -}} diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_k0smotronControlPlaneTemplateSpec.yaml b/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_k0smotronControlPlaneTemplateSpec.yaml index 2c77521b55..4b6194f793 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_k0smotronControlPlaneTemplateSpec.yaml +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/k0smotronControlPlaneTemplate/_k0smotronControlPlaneTemplateSpec.yaml @@ -41,11 +41,11 @@ k0sConfig: {{- $values := dict "cgroupDriver" "systemd" }} {{ $values = mustMerge $values (include "t8s-cluster.kubelet.options" (dict) | fromYaml) }} {{ $values = mustMerge $values (include "t8s-cluster.patches.kubelet.imagePulls" (dict "context" .) | fromYaml) }} - values: {{- $values | toYaml | nindent 10 }} + values: {{- toYaml $values | nindent 10 }} featureGates: {{- range $featureGate, $components := include "t8s-cluster.featureGates" (dict) | fromYaml }} - name: {{ $featureGate }} enabled: true - components: {{- $components | toYaml | nindent 10 }} + components: {{- toYaml $components | nindent 10 }} {{- end }} etcd: persistence: diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/kubeadmControlPlaneTemplate/_helpers.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/kubeadmControlPlaneTemplate/_helpers.tpl index a4cd9de58b..575eada615 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/kubeadmControlPlaneTemplate/_helpers.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/kubeadmControlPlaneTemplate/_helpers.tpl @@ -1,8 +1,6 @@ {{- define "t8s-cluster.clusterClass.kubeadmControlPlaneTemplate.specHash" -}} {{/* the full context is needed for .Files.Get */}} - {{- $inputs := (dict - "spec" (include "t8s-cluster.clusterClass.kubeadmControlPlaneTemplate.spec" $) - ) -}} + {{- $inputs := dict "spec" (include "t8s-cluster.clusterClass.kubeadmControlPlaneTemplate.spec" $) -}} {{- mustToJson $inputs | toString | quote | sha1sum | trunc 8 -}} {{- end -}} @@ -23,7 +21,7 @@ "admission-control-config.yaml" (required "Missing" .admissionControlConfigFilePath) "event-rate-limit-config.yaml" (required "Missing" .eventRateLimitConfigFilePath) "kube-proxy.config.yaml" "/etc/kube-proxy-config.yaml" - -}} + -}} {{- range $file, $path := $configs -}} {{- $files = append $files (dict "content" ($.Files.Get (printf "files/%s" $file)) "path" $path) -}} {{- end -}} @@ -33,5 +31,5 @@ {{- end -}} {{- $apiserverPatch := dict "spec" (dict "containers" (list (dict "name" "kube-apiserver" "resources" (dict "requests" (dict "memory" "2Gi") "limits" (dict "memory" "4Gi"))))) -}} {{- $files = append $files (include "t8s-cluster.patches.patchFile" (dict "values" $apiserverPatch "target" "kube-apiserver" "component" "memory") | fromYaml) -}} - {{- $files | toYaml -}} + {{- toYaml $files -}} {{- end -}} diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackClusterTemplate/_helpers.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackClusterTemplate/_helpers.tpl index c18b428d23..2909af3e22 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackClusterTemplate/_helpers.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackClusterTemplate/_helpers.tpl @@ -1,7 +1,7 @@ {{- define "t8s-cluster.clusterClass.openStackClusterTemplate.specHash" -}} - {{- $inputs := (dict + {{- $inputs := dict "spec" (include "t8s-cluster.clusterClass.openStackClusterTemplate.spec" (dict "context" .context)) "infrastructureApiVersion" (include "t8s-cluster.clusterClass.infrastructureApiVersion" (dict)) - ) -}} + -}} {{- mustToJson $inputs | toString | quote | sha1sum | trunc 8 -}} {{- end -}} diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackMachineTemplates/_helpers.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackMachineTemplates/_helpers.tpl index 9ceafae3a8..2bdc30dd23 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackMachineTemplates/_helpers.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/openStackMachineTemplates/_helpers.tpl @@ -1,8 +1,8 @@ {{- define "t8s-cluster.clusterClass.openStackMachineTemplate.specHash" -}} - {{- $inputs := (dict + {{- $inputs := dict "spec" (include "t8s-cluster.clusterClass.openStackMachineTemplate.spec" (dict "name" .name "context" .context)) "infrastructureApiVersion" (include "t8s-cluster.clusterClass.infrastructureApiVersion" (dict)) - ) -}} + -}} {{- mustToJson $inputs | toString | quote | sha1sum | trunc 8 -}} {{- end -}} diff --git a/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl b/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl index f2849f0cde..5bf58e3ade 100644 --- a/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl +++ b/charts/t8s-cluster/templates/management-cluster/clusterClass/patches/_kubelet.tpl @@ -4,7 +4,7 @@ {{- if and (or (gt (.Values.version.major | int) 1) (ge (.Values.version.minor | int) 27)) (gt (int .Values.global.kubeletExtraConfig.maxParallelImagePulls) 1) -}} {{- $values = mustMerge $values (dict "serializeImagePulls" false "maxParallelImagePulls" .Values.global.kubeletExtraConfig.maxParallelImagePulls) -}} {{- end -}} - {{- $values | toYaml -}} + {{- toYaml $values -}} {{- end -}} {{- define "t8s-cluster.kubelet.featureGates"}} @@ -17,7 +17,7 @@ {{- $options = set $options "protectKernelDefaults" true -}} {{- $options = set $options "tlsCipherSuites" (include "t8s-cluster.clusterClass.tlsCipherSuites" (dict) | fromYamlArray) -}} {{- $options = set $options "seccompDefault" true -}} - {{- $options | toYaml -}} + {{- toYaml $options -}} {{- end -}} {{- define "t8s-cluster.patches.kubelet.default" -}} @@ -35,7 +35,7 @@ {{- end -}} {{- $patches = append $patches (include "t8s-cluster.patches.patchFile" (dict "values" $cleanupJsonPatch "target" "kubeletconfiguration" "suffix" 0 "patchType" "json") | fromYaml) -}} {{- $patches = append $patches (include "t8s-cluster.patches.patchFile" (dict "values" $values "target" "kubeletconfiguration" "component" "default") | fromYaml) -}} - {{- $patches | toYaml -}} + {{- toYaml $patches -}} {{- end -}} {{- define "t8s-cluster.patches.kubelet.patches" -}}