-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(schd): returning list of preferred nodes for scheduling #2
Conversation
Scheduler should return list of preferred nodes for scheduling. It is up to the user of this libary which can pick first node in the preferred list or can try on all the nodes in the order returned by the scheduler. This can solve the issue where csi controller is not able to create the volume on first node, it can pick the next one in the list. Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
@@ -56,43 +62,68 @@ func getNodeList(topo *csi.TopologyRequirement) ([]string, error) { | |||
|
|||
// runScheduler goes through the node mapping | |||
// in the topology and picks the node which is less weighted | |||
func runScheduler(nodelist []string, nmap map[string]int64) string { | |||
var selected string | |||
func runScheduler(nodelist []string, nmap map[string]int64) []string { |
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.
n_: the comments needs to change to reflect the change in the logic.
topo := req.AccessibilityRequirements | ||
if topo == nil || | ||
len(topo.Preferred) == 0 { | ||
func Scheduler(req *csi.CreateVolumeRequest, nmap map[string]int64) []string { |
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.
q_: is it required to maintain backward compatibility for this API so that any of the CSI drivers using this method can still work, after this is merged and if they are using the latest code from this repo (without changing their code.
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.
it will work even after the merge because of the gomod.
Signed-off-by: Pawan <pawan@mayadata.io>
Scheduler should return list of preferred nodes for scheduling.
It is up to the user of this libary which can pick first node in
the preferred list or can try on all the nodes in the order returned
by the scheduler.
This can solve the issue where csi controller is not able to create
the volume on first node, it can pick the next one in the list.
Signed-off-by: Pawan pawan@mayadata.io