Skip to content
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

Simplify setup with using dynamic scheduler extenders #171

Open
liyimeng opened this issue Sep 8, 2022 · 4 comments
Open

Simplify setup with using dynamic scheduler extenders #171

liyimeng opened this issue Sep 8, 2022 · 4 comments

Comments

@liyimeng
Copy link

liyimeng commented Sep 8, 2022

Why you need it?

Right now open-local use an init-job to statically configure scheduler extends, this is not convenient for some k8s distribution like k3s. I would like to propose doing this at controller startup instead of using external json/yaml file.

How it could be?

when open-local controller startup, it uses client-go to create the scheduler config (https://kubernetes.io/docs/reference/config-api/kube-scheduler-config.v1beta3/), when it quick delete the config.

This should make open-local work much smart and stable. :)

Other related information

https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#extended-resources

@liyimeng
Copy link
Author

liyimeng commented Sep 8, 2022

I.e. use client-go in open-local controller populate this info into etcd database.

{
            "kind" : "Policy",
            "apiVersion" : "v1",
            "extenders" : [{
                "urlPrefix": "http://{{ .Values.extender.name }}.{{.Values.namespace}}:23000/scheduler",
                "filterVerb": "predicates",
                "prioritizeVerb": "priorities",
                "preemptVerb": "",
                "bindVerb": "",
                "weight": 10,
                "enableHttps": false,
                "nodeCacheCapable": true,
                "ignorable": true
            }],
            "hardPodAffinitySymmetricWeight" : 10
            }

@TheBeatles1994
Copy link
Collaborator

Thx for your proposal, that's what we planned to do, and it would be great if you could do it😊.

@liyimeng
Copy link
Author

Thx for your proposal, that's what we planned to do, and it would be great if you could do it😊.

I can do it, but I prefer doing it on top of your refact :)

@songshusen1978
Copy link

1. 停止K3S, 手动编写/var/lib/rancher/k3s/server/kube-scheduler-configuration.yaml配置文件

    systemctl stop k3s
apiVersion: kubescheduler.config.k8s.io/v1alpha1
kind: KubeSchedulerConfiguration
clientConnection:
  kubeconfig: /var/lib/rancher/k3s/server/cred/scheduler.kubeconfig
extenders:
- urlPrefix: http://open-local-scheduler-extender.open-local:23000/scheduler
  filterVerb: predicates
  prioritizeVerb: priorities
  weight: 10
  ignorable: true
  nodeCacheCapable: true

2. 修改K3S的启动参数

在/etc/systemd/system/k3s.service文件的k3s启动参数增加如下内容

'--kube-scheduler-arg'
'config=/var/lib/rancher/k3s/server/kube-scheduler-configuration.yaml' \

3. 重新启动K3S

systemctl daemon-reload
systemctl start k3s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants