From 2b5950c24c9a75a9dab6c1f23794723479da4805 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Sat, 12 Sep 2020 08:24:29 +0200 Subject: [PATCH] Add missing flags to template --- pkg/model/components/clusterautoscaler.go | 3 +++ upup/models/bindata.go | 21 ++++++++++++------- .../k8s-1.15.yaml.template | 19 ++++++++++------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/pkg/model/components/clusterautoscaler.go b/pkg/model/components/clusterautoscaler.go index 52a2c12c8a..af49159a2c 100644 --- a/pkg/model/components/clusterautoscaler.go +++ b/pkg/model/components/clusterautoscaler.go @@ -77,6 +77,9 @@ func (b *ClusterAutoscalerOptionsBuilder) BuildOptions(o interface{}) error { if cas.SkipNodesWithSystemPods == nil { cas.SkipNodesWithSystemPods = fi.Bool(true) } + if cas.BalanceSimilarNodeGroups == nil { + cas.BalanceSimilarNodeGroups = fi.Bool(false) + } return nil } diff --git a/upup/models/bindata.go b/upup/models/bindata.go index 7dc0db642f..06e1e2cc31 100644 --- a/upup/models/bindata.go +++ b/upup/models/bindata.go @@ -856,7 +856,8 @@ func cloudupResourcesAddonsAuthenticationKopeIoK8s18Yaml() (*asset, error) { return a, nil } -var _cloudupResourcesAddonsClusterAutoscalerAddonsK8sIoK8s115YamlTemplate = []byte(`# Sourced from https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws/examples +var _cloudupResourcesAddonsClusterAutoscalerAddonsK8sIoK8s115YamlTemplate = []byte(`{{ with .ClusterAutoscaler }} +# Sourced from https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws/examples --- apiVersion: v1 kind: ServiceAccount @@ -999,7 +1000,7 @@ spec: nodeSelector: node-role.kubernetes.io/master: "" containers: - - image: {{ .ClusterAutoscaler.Image }} + - image: {{ .Image }} name: cluster-autoscaler resources: limits: @@ -1010,14 +1011,17 @@ spec: memory: 300Mi command: - ./cluster-autoscaler - - --v=2 - - --stderrthreshold=info - - --cloud-provider={{ .CloudProvider }} - - --skip-nodes-with-local-storage={{ .ClusterAutoscaler.SkipNodesWithLocalStorage }} - - --expander={{ .ClusterAutoscaler.Expander }} + - --balance-similar-node-groups={{ .BalanceSimilarNodeGroups }} + - --cloud-provider={{ $.CloudProvider }} + - --expander={{ .Expander }} {{ range $name, $spec := GetNodeInstanceGroups }} - --nodes={{ $spec.MinSize }}:{{ $spec.MaxSize }}:{{ $name }} {{ end }} + - --scale-down-utilization-threshold={{ .ScaleDownUtilizationThreshold }} + - --skip-nodes-with-local-storage={{ .SkipNodesWithLocalStorage }} + - --skip-nodes-with-system-pods={{ .SkipNodesWithSystemPods }} + - --stderrthreshold=info + - --v=2 ports: - containerPort: 8085 protocol: TCP @@ -1029,7 +1033,8 @@ spec: scheme: HTTP periodSeconds: 10 successThreshold: 1 - timeoutSeconds: 1`) + timeoutSeconds: 1 +{{ end }}`) func cloudupResourcesAddonsClusterAutoscalerAddonsK8sIoK8s115YamlTemplateBytes() ([]byte, error) { return _cloudupResourcesAddonsClusterAutoscalerAddonsK8sIoK8s115YamlTemplate, nil diff --git a/upup/models/cloudup/resources/addons/cluster-autoscaler.addons.k8s.io/k8s-1.15.yaml.template b/upup/models/cloudup/resources/addons/cluster-autoscaler.addons.k8s.io/k8s-1.15.yaml.template index 0cd4c5ce82..e0e3aa10d5 100644 --- a/upup/models/cloudup/resources/addons/cluster-autoscaler.addons.k8s.io/k8s-1.15.yaml.template +++ b/upup/models/cloudup/resources/addons/cluster-autoscaler.addons.k8s.io/k8s-1.15.yaml.template @@ -1,3 +1,4 @@ +{{ with .ClusterAutoscaler }} # Sourced from https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler/cloudprovider/aws/examples --- apiVersion: v1 @@ -141,7 +142,7 @@ spec: nodeSelector: node-role.kubernetes.io/master: "" containers: - - image: {{ .ClusterAutoscaler.Image }} + - image: {{ .Image }} name: cluster-autoscaler resources: limits: @@ -152,14 +153,17 @@ spec: memory: 300Mi command: - ./cluster-autoscaler - - --v=2 - - --stderrthreshold=info - - --cloud-provider={{ .CloudProvider }} - - --skip-nodes-with-local-storage={{ .ClusterAutoscaler.SkipNodesWithLocalStorage }} - - --expander={{ .ClusterAutoscaler.Expander }} + - --balance-similar-node-groups={{ .BalanceSimilarNodeGroups }} + - --cloud-provider={{ $.CloudProvider }} + - --expander={{ .Expander }} {{ range $name, $spec := GetNodeInstanceGroups }} - --nodes={{ $spec.MinSize }}:{{ $spec.MaxSize }}:{{ $name }} {{ end }} + - --scale-down-utilization-threshold={{ .ScaleDownUtilizationThreshold }} + - --skip-nodes-with-local-storage={{ .SkipNodesWithLocalStorage }} + - --skip-nodes-with-system-pods={{ .SkipNodesWithSystemPods }} + - --stderrthreshold=info + - --v=2 ports: - containerPort: 8085 protocol: TCP @@ -171,4 +175,5 @@ spec: scheme: HTTP periodSeconds: 10 successThreshold: 1 - timeoutSeconds: 1 \ No newline at end of file + timeoutSeconds: 1 +{{ end }} \ No newline at end of file