I am implementing a custom scheduler for k8s, which works in the scoring stage. A certain function needs to first obtain the nodes that have been filtered by various default filters. I did not find any related functions or methods in the code /
I am implementing a custom scheduler for k8s, which works in the scoring stage. A certain function needs to first obtain the nodes that have been filtered by various default filters. I did not find any related functions or methods in the code https://github/kubernetes/kubernetes/blob/master/pkg/scheduler/
Share Improve this question asked Mar 3 at 9:33 lhb6540lhb6540 151 silver badge3 bronze badges 1- Refer to this Kubernetes Scheduler and Medium Blog by Platform Engineers which may help to resolve your issue. – Hemanth Kanchumurthy Commented Mar 3 at 12:41
1 Answer
Reset to default 0You can use clientset from Go Client library, including nodes client and list method with for example LabelSelector. Here is the example:
nodes, err := clientset.CoreV1().Nodes().List(
context.TODO(),
metav1.ListOptions{LabelSelector: labelSelector},
)
Here just need to add metav1 List Options and you can do specific search.