Skip to content
Snippets Groups Projects
Unverified Commit 73bc5ced authored by Maksim Paskal's avatar Maksim Paskal Committed by GitHub
Browse files

[enhancement] Use native kubernetes topology region label for volumes nodeAffinity (#302)


autoscaler topology label

Signed-off-by: default avatarMaksim Paskal <paskal.maksim@gmail.com>
parent b89386d1
No related branches found
No related tags found
No related merge requests found
package driver package driver
import (
apiv1 "k8s.io/api/core/v1"
)
const ( const (
PluginName = "csi.hetzner.cloud" PluginName = "csi.hetzner.cloud"
PluginVersion = "1.6.0" PluginVersion = "1.6.0"
...@@ -8,5 +12,8 @@ const ( ...@@ -8,5 +12,8 @@ const (
MinVolumeSize = 10 // GB MinVolumeSize = 10 // GB
DefaultVolumeSize = MinVolumeSize DefaultVolumeSize = MinVolumeSize
TopologySegmentLocation = PluginName + "/location" TopologySegmentLocation = apiv1.LabelZoneRegionStable
// this label will be deprecated in future releases
TopologySegmentLocationLegacy = PluginName + "/location"
) )
...@@ -172,7 +172,12 @@ func (s *NodeService) NodeGetInfo(context.Context, *proto.NodeGetInfoRequest) (* ...@@ -172,7 +172,12 @@ func (s *NodeService) NodeGetInfo(context.Context, *proto.NodeGetInfoRequest) (*
MaxVolumesPerNode: MaxVolumesPerNode, MaxVolumesPerNode: MaxVolumesPerNode,
AccessibleTopology: &proto.Topology{ AccessibleTopology: &proto.Topology{
Segments: map[string]string{ Segments: map[string]string{
// need this topology key for k8s clusters without hcloud-cloud-controller-manager
// that handles this node label
TopologySegmentLocation: s.serverLocation, TopologySegmentLocation: s.serverLocation,
// need this topology key for backward compatibility
// for PV created with older version this CSI driver
TopologySegmentLocationLegacy: s.serverLocation,
}, },
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment