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

How to apply this schedule extender to kind Kubernetes cluster #5

Open
srini1978 opened this issue Jul 27, 2020 · 3 comments
Open

How to apply this schedule extender to kind Kubernetes cluster #5

srini1978 opened this issue Jul 27, 2020 · 3 comments

Comments

@srini1978
Copy link

srini1978 commented Jul 27, 2020

Hi,
I am running a Kubernetes cluster using kind. To apply the schedule extender policy.json i need to apply this to kube-scheduler . however i am getting a kube-scheduler: command not found

I am trying to use the same extender logic for kube-scheduler. How will "kind" be able to work with this scheduler and customize it ?
Any pointers?

@srini1978 srini1978 changed the title How to apply this to kind How to apply this schedule extender to kind Kubernetes cluster Jul 27, 2020
@Huang-Wei
Copy link
Owner

With kind, you may need to tweak the kube-scheduler startup arguments to pass-in the policy.{json|yaml}.

The first step is to craft the static scheduler Pod yaml to replace the default one inside container kind-control-plane. e.g.,

apiVersion: v1
kind: Pod
metadata:
  labels:
    component: kube-scheduler
    tier: control-plane
  name: kube-scheduler
  namespace: kube-system
spec:
  containers:
  - command:
    - kube-scheduler
    - --authentication-kubeconfig=/etc/kubernetes/scheduler.conf
    - --authorization-kubeconfig=/etc/kubernetes/scheduler.conf
    - --bind-address=127.0.0.1
    - --config=/etc/kubernetes/sched-config-v1alpha1.yaml
    # - --kubeconfig=/etc/kubernetes/scheduler.conf
    # - --leader-elect=true
......

And then in /etc/kubernetes/sched-config-v1alpha1.yaml, pass-in the extender policy via File or ConfigMap.

Hope this helps.

@srini1978
Copy link
Author

Thanks @Huang-Wei . So the procedure is

  1. Create the above file as some x.yaml
  2. On the kind cluster that i have, submit the deployment using kubectl apply -f some.yaml
  3. Now we have made kind cluster to recognize the scheduler extender we have installed on http://localhost:8888 (i was able to extend your repository and set up filter and prioritize actions on my machine)

Let me know if i got it right ? Also i did not fully understand the yaml file above. do you have an example ?

@Huang-Wei
Copy link
Owner

Nope. The yaml should replace the scheduler pod yaml inside kind-control-plane container at path /etc/kubernetes/manifests.

Also i did not fully understand the yaml file above. do you have an example ?

The original default scheduler pod yaml could be obtained also at that path. You can check it out.

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

2 participants