Skip to content

Commit

Permalink
Merge pull request #4061 from marwanad/stable-zone-labels
Browse files Browse the repository at this point in the history
add stable zone labels in azure template generation
  • Loading branch information
k8s-ci-robot authored May 6, 2021
2 parents c6d4535 + dda7db0 commit 67dc894
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cluster-autoscaler/cloudprovider/azure/azure_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func buildGenericLabels(template compute.VirtualMachineScaleSet, nodeName string

result[apiv1.LabelInstanceType] = *template.Sku.Name
result[apiv1.LabelZoneRegion] = strings.ToLower(*template.Location)
result[apiv1.LabelTopologyRegion] = strings.ToLower(*template.Location)

if template.Zones != nil && len(*template.Zones) > 0 {
failureDomains := make([]string, len(*template.Zones))
Expand All @@ -60,8 +61,10 @@ func buildGenericLabels(template compute.VirtualMachineScaleSet, nodeName string
}

result[apiv1.LabelZoneFailureDomain] = strings.Join(failureDomains[:], cloudvolume.LabelMultiZoneDelimiter)
result[apiv1.LabelTopologyZone] = strings.Join(failureDomains[:], cloudvolume.LabelMultiZoneDelimiter)
} else {
result[apiv1.LabelZoneFailureDomain] = "0"
result[apiv1.LabelTopologyZone] = "0"
}

result[apiv1.LabelHostname] = nodeName
Expand Down

0 comments on commit 67dc894

Please sign in to comment.