How to apply custom scheduler for kubernetes(kubeadm)

12/16/2017

When I test Custom scheduler, but my pods status is still pending. https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/

I made a new custom scheduler and 3 test pods like k8s sample yaml but, pods using 'default-scheduler' works well, but pods using 'my-scheduler' doesn't work.

I don't know how to fix this problem. Please help me.

1.Environment:

  1. Kubernetes version (use kubectl version):

    Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.5", GitCommit:"cce11c6a185279d037023e02ac5249e14daa22bf", GitTreeState:"clean", BuildDate:"2017-12-07T16:16:03Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.5", GitCommit:"cce11c6a185279d037023e02ac5249e14daa22bf", GitTreeState:"clean", BuildDate:"2017-12-07T16:05:18Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

  2. Cloud provider or hardware configuration:

  3. OS (e.g. from /etc/os-release):

    NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="7" PRETTY_NAME="CentOS Linux 7 (Core)" ANSI_COLOR="0;31"

  4. Kernel (e.g. uname -a):

    Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

2.procedure

  1. kubectl apply -f my-schudler.yaml

enter image description here

  1. when i setup ks8s using kubeadm, authorization option set to Node, RBAC, so I modified clusterrole like this kubectl edit clusterrole system:kube-scheduler

enter image description here

  1. kubectl apply -f no.yaml

  2. kubectl apply -f default.yaml

  3. kubectl apply -f my-scheduler.yaml enter image description here

-- ceounii lee
kubernetes

1 Answer

12/26/2017

Please share the the content of your my-scheduler.yaml. Did you submit all the pod configs to a Kubernetes cluster before submitting the scheduler deployment config? From your commands, I can see no.yaml executing first, this is possibly what’s causing the issue. Order is important with scheduling.

Can you also check the event and Linux system logs for container issues with the keyword “Scheduled”, you might see the problems and you can share the log file. This wiki can give you more information on Kubernetes operations, too.

-- Oron Zimmer
Source: StackOverflow