-
Notifications
You must be signed in to change notification settings - Fork 30
Provision vsphere volumes as per zone and attach labels #517
base: vsphere_volume_zone_base
Are you sure you want to change the base?
Conversation
| } | ||
|
|
||
| func (nm *NodeManager) UnRegisterNode(node *v1.Node) error { | ||
| klog.V(4).Infof("UnRegister node called: %v", *node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| } | ||
|
|
||
| func (nm *NodeManager) RediscoverNode(nodeName k8stypes.NodeName) error { | ||
| klog.V(4).Infof("Rediscover node called: %v", nodeName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| } | ||
| } | ||
| if !found { | ||
| msg := fmt.Sprintf("The specified datastore %s does not match the provided availability zones : %s", volumeOptions.Datastore, volumeOptions.Zone) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use fmt.Errorf(...) instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
|
||
| // Create cloudprovider.Zone type from selectedZones | ||
| var cpZones []cloudprovider.Zone | ||
| for _, selectedZone := range selectedZones { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think duplicates should be handled here. Not a functionality problem, but for a better performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate validation is already taken care as part of SC creation. Hence, need not be handled here.
|
Addressed Subbu's comments. |
6723a1e to
5b53c5d
Compare
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently vsphere cloud provider (VCP) insists on provisioning a volume only on a globally shared datastore. Hence, in a zoned environment, even in presence of a shared datastore within a specific zone, the volume provisioning can fail if that datastore is not shared across all the zones hosting kubernetes nodes. This change fixes this issue by considering the zone information provided in allowedTopologies for selection of the datastore. If allowedTopologies is not provided, the current behaviour is retained as-is.
Further, after a volume is created on vSphere, the zone label does not get applied on it today. Without this information on the volume, a pod that uses this volume could get scheduled to a different zone where this volume is not visible/accessible. This issue can be solved by just labeling the volume with the zone information. This PR computes the zone of a volume in the PersistentVolumeLabel admission controller since vsphere is still an in-tree cloud provider and the out-of-tree plugin in still the works.
Which issue(s) this PR fixes:
Fixes kubernetes#67703
Does this PR introduce a user-facing change?:
Yes