diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager.go b/cluster-autoscaler/cloudprovider/aws/aws_manager.go index b35bd2d698df..c18de984b1d6 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager.go @@ -56,6 +56,7 @@ const ( autoDiscovererTypeASG = "asg" asgAutoDiscovererKeyTag = "tag" optionsTagsPrefix = "k8s.io/cluster-autoscaler/node-template/autoscaling-options/" + labelAwsCSITopologyZone = "topology.ebs.csi.aws.com/zone" ) // AwsManager is handles aws communication and data caching. @@ -532,6 +533,7 @@ func buildGenericLabels(template *asgTemplate, nodeName string) map[string]strin result[apiv1.LabelTopologyRegion] = template.Region result[apiv1.LabelTopologyZone] = template.Zone + result[labelAwsCSITopologyZone] = template.Zone result[apiv1.LabelHostname] = nodeName return result } diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go b/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go index a7ae8aac708c..362407430838 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go @@ -91,8 +91,11 @@ func TestBuildGenericLabels(t *testing.T) { Architecture: cloudprovider.DefaultArch, }, Region: "us-east-1", + Zone: "us-east-1c", }, "sillyname") - assert.Equal(t, "us-east-1", labels[apiv1.LabelZoneRegionStable]) + assert.Equal(t, "us-east-1", labels[apiv1.LabelTopologyRegion]) + assert.Equal(t, "us-east-1c", labels[apiv1.LabelTopologyZone]) + assert.Equal(t, "us-east-1c", labels[labelAwsCSITopologyZone]) assert.Equal(t, "sillyname", labels[apiv1.LabelHostname]) assert.Equal(t, "c4.large", labels[apiv1.LabelInstanceTypeStable]) assert.Equal(t, cloudprovider.DefaultArch, labels[apiv1.LabelArchStable])