最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

kubernetes - how to get filtered nodes in k8s scheduler api - Stack Overflow

programmeradmin0浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

You 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.

发布评论

评论列表(0)

  1. 暂无评论