diff --git a/pkg/providers/cloudstack/config/template-md.yaml b/pkg/providers/cloudstack/config/template-md.yaml index 4229bbe63874f..0c6607befceb9 100644 --- a/pkg/providers/cloudstack/config/template-md.yaml +++ b/pkg/providers/cloudstack/config/template-md.yaml @@ -133,14 +133,16 @@ metadata: cluster.x-k8s.io/cluster-name: {{.clusterName}} name: {{.workerNodeGroupName}} namespace: {{.eksaSystemNamespace}} - {{- if .autoscalingConfig }} +{{- if .autoscalingConfig }} annotations: cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "{{ .autoscalingConfig.MinCount }}" cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "{{ .autoscalingConfig.MaxCount }}" {{- end }} spec: clusterName: {{.clusterName}} +{{- if not .autoscalingConfig }} replicas: {{.workerReplicas}} +{{- end }} selector: matchLabels: {} template: diff --git a/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml b/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml index a4c30a6cd0469..a69af7639a2ab 100644 --- a/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml +++ b/pkg/providers/cloudstack/testdata/expected_results_main_autoscaling_md.yaml @@ -73,7 +73,6 @@ metadata: cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5" spec: clusterName: test - replicas: 3 selector: matchLabels: {} template: diff --git a/pkg/providers/docker/config/template-md.yaml b/pkg/providers/docker/config/template-md.yaml index b0e9cc8592ce1..8a806cc3d87fd 100644 --- a/pkg/providers/docker/config/template-md.yaml +++ b/pkg/providers/docker/config/template-md.yaml @@ -87,7 +87,9 @@ metadata: {{- end }} spec: clusterName: {{.clusterName}} +{{- if not .autoscalingConfig }} replicas: {{.workerReplicas}} +{{- end }} selector: matchLabels: null template: diff --git a/pkg/providers/docker/testdata/valid_autoscaler_deployment_md_expected.yaml b/pkg/providers/docker/testdata/valid_autoscaler_deployment_md_expected.yaml index 57092cdf7f8ae..c0aa5ac7c1703 100644 --- a/pkg/providers/docker/testdata/valid_autoscaler_deployment_md_expected.yaml +++ b/pkg/providers/docker/testdata/valid_autoscaler_deployment_md_expected.yaml @@ -25,7 +25,6 @@ metadata: cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5" spec: clusterName: test-cluster - replicas: 3 selector: matchLabels: null template: diff --git a/pkg/providers/nutanix/config/md-template.yaml b/pkg/providers/nutanix/config/md-template.yaml index ac63a9ffff750..b42cefe60e845 100644 --- a/pkg/providers/nutanix/config/md-template.yaml +++ b/pkg/providers/nutanix/config/md-template.yaml @@ -5,14 +5,16 @@ metadata: cluster.x-k8s.io/cluster-name: "{{.clusterName}}" name: "{{.workerNodeGroupName}}" namespace: "{{.eksaSystemNamespace}}" - {{- if .autoscalingConfig }} +{{- if .autoscalingConfig }} annotations: cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "{{ .autoscalingConfig.MinCount }}" cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "{{ .autoscalingConfig.MaxCount }}" - {{- end }} +{{- end }} spec: clusterName: "{{.clusterName}}" +{{- if not .autoscalingConfig }} replicas: {{.workerReplicas}} +{{- end }} selector: matchLabels: {} template: diff --git a/pkg/providers/nutanix/testdata/expected_results_autoscaling_md.yaml b/pkg/providers/nutanix/testdata/expected_results_autoscaling_md.yaml index 3a2a9fc1eba38..36350779f950c 100644 --- a/pkg/providers/nutanix/testdata/expected_results_autoscaling_md.yaml +++ b/pkg/providers/nutanix/testdata/expected_results_autoscaling_md.yaml @@ -10,7 +10,6 @@ metadata: cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5" spec: clusterName: "eksa-unit-test" - replicas: 3 selector: matchLabels: {} template: diff --git a/pkg/providers/tinkerbell/config/template-md.yaml b/pkg/providers/tinkerbell/config/template-md.yaml index 83e39ed128df3..726b7a4eea5b9 100644 --- a/pkg/providers/tinkerbell/config/template-md.yaml +++ b/pkg/providers/tinkerbell/config/template-md.yaml @@ -13,7 +13,9 @@ metadata: {{- end }} spec: clusterName: {{.clusterName}} +{{- if not .autoscalingConfig }} replicas: {{.workerReplicas}} +{{- end }} selector: matchLabels: {} template: diff --git a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml index 38be178580505..eab49bb2312b5 100644 --- a/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml +++ b/pkg/providers/tinkerbell/testdata/expected_results_cluster_tinkerbell_autoscaler_md.yaml @@ -11,7 +11,6 @@ metadata: cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5" spec: clusterName: test - replicas: 1 selector: matchLabels: {} template: diff --git a/pkg/providers/vsphere/config/template-md.yaml b/pkg/providers/vsphere/config/template-md.yaml index 164b6c2de1a8a..62e32ed3f4b33 100644 --- a/pkg/providers/vsphere/config/template-md.yaml +++ b/pkg/providers/vsphere/config/template-md.yaml @@ -172,7 +172,9 @@ metadata: {{- end }} spec: clusterName: {{.clusterName}} +{{- if not .autoscalingConfig }} replicas: {{.workerReplicas}} +{{- end }} selector: matchLabels: {} template: diff --git a/pkg/providers/vsphere/testdata/expected_results_minimal_autoscaling_md.yaml b/pkg/providers/vsphere/testdata/expected_results_minimal_autoscaling_md.yaml index 0d8968d4bc8d9..b9918819ddb09 100644 --- a/pkg/providers/vsphere/testdata/expected_results_minimal_autoscaling_md.yaml +++ b/pkg/providers/vsphere/testdata/expected_results_minimal_autoscaling_md.yaml @@ -41,7 +41,6 @@ metadata: cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5" spec: clusterName: test - replicas: 3 selector: matchLabels: {} template: