<p>I deploy a custom scheduler after following instructions step by step like mentioned in Kubernetes Documentation</p>

<p>Here's [a link] (<a href="https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/</a>)</p>

<p>Pods I specify should be scheduled using the scheduler that I deployed "my-scheduler" leaves in Pending.</p>

<pre><code>Kubectl version : -Client: v1.14.1
                  -Server: v1.14.0

kubeadm version : v1.14.1



alisd@kubeMaster:~$ kubectl get pods -n kube-system
NAME                                 READY   STATUS    RESTARTS   AGE
calico-node-944jv                    2/2     Running   4          45h
coredns-fb8b8dccf-hzzwf              1/1     Running   2          45h
coredns-fb8b8dccf-zb228              1/1     Running   2          45h
etcd-kubemaster                      1/1     Running   3          45h
kube-apiserver-kubemaster            1/1     Running   3          45h
kube-controller-manager-kubemaster   1/1     Running   3          45h
kube-proxy-l6wrc                     1/1     Running   3          45h
kube-scheduler-kubemaster            1/1     Running   3          45h
my-scheduler-66cf896bfb-8j8sr        1/1     Running   2          45h


alisd@kubeMaster:~$ kubectl get pods
NAME                          READY   STATUS    RESTARTS   AGE
annotation-second-scheduler   0/1     Pending   0          4s



alisd@kubeMaster:~$ kubectl describe pod annotation-second-scheduler
Name:               annotation-second-scheduler
Namespace:          default
Priority:           0
PriorityClassName:  &lt;none&gt;
Node:               &lt;none&gt;
Labels:             name=multischeduler-example
Annotations:        &lt;none&gt;
Status:             Pending
IP:                 
Containers:
  pod-with-second-annotation-container:
    Image:        k8s.gcr.io/pause:2.0
    Port:         &lt;none&gt;
    Host Port:    &lt;none&gt;
    Environment:  &lt;none&gt;
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-jclk7 (ro)
Volumes:
  default-token-jclk7:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-jclk7
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:          &lt;none&gt;







alisd@kubeMaster:~$ kubectl logs -f my-scheduler-66cf896bfb-8j8sr -n kube-system



E0426 14:44:01.742799       1 reflector.go:126] k8s.io/client-go/informers/factory.go:133: Failed to list *v1.StorageClass: storageclasses.storage.k8s.io is forbidden: User "system:serviceaccount:kube-system:my-scheduler" cannot list resource "storageclasses" in API group "storage.k8s.io" at the cluster scope
E0426 14:44:02.743952       1 reflector.go:126] k8s.io/client-go/informers/factory.go:133: Failed to list *v1.StorageClass: storageclasses.storage.k8s.io is forbidden: User "system:serviceaccount:kube-system:my-scheduler" cannot list resource "storageclasses" in API group "storage.k8s.io" at the cluster scope
</code></pre>

<p>.....</p>

<pre><code>alisd@kubeMaster:~$ kubectl get clusterrolebinding
NAME                                                   AGE
calico-node                                            46h
cluster-admin                                          46h
kubeadm:kubelet-bootstrap                              46h
kubeadm:node-autoapprove-bootstrap                     46h
kubeadm:node-autoapprove-certificate-rotation          46h
kubeadm:node-proxier                                   46h
my-scheduler-as-kube-scheduler                         46h
</code></pre>

<p>......</p>

<pre><code>alisd@kubeMaster:~$ kubectl describe clusterrolebinding my-scheduler-as-kube-scheduler
Name:         my-scheduler-as-kube-scheduler
Labels:       &lt;none&gt;
Annotations:  &lt;none&gt;
Role:
  Kind:  ClusterRole
  Name:  system:kube-scheduler
Subjects:
  Kind            Name          Namespace
  ----            ----          ---------
  ServiceAccount  my-scheduler  kube-system
</code></pre>

<p>........</p>

<pre><code>alisd@kubeMaster:~$ kubectl describe serviceaccount my-scheduler -n kube-systemName:                my-scheduler
Namespace:           kube-system
Labels:              &lt;none&gt;
Annotations:         &lt;none&gt;
Image pull secrets:  &lt;none&gt;
Mountable secrets:   my-scheduler-token-68pvk
Tokens:              my-scheduler-token-68pvk
Events:              &lt;none&gt;
</code></pre>

<p>.......</p>

<p>I've found a solution</p>

<p>Add these lines:</p>

<pre><code>- apiGroups:
  - storage.k8s.io
  resources:
  - storageclasses
  verbs:
  - watch
  - list
  - get
</code></pre>

<p>to the end of the output of this command (this opens a file for you to edit):</p>

<pre><code>kubectl edit clusterrole system:kube-scheduler
</code></pre>

<p>The pod using the scheduler that I deployed is now Running </p>

<pre><code>alisd@kubeMaster:~$ kubectl get pods 
NAME                          READY   STATUS    RESTARTS   AGE
annotation-second-scheduler   1/1     Running   0          9m33s
</code></pre>

<p>......</p>

<pre><code>kubectl describe pod annotation-second-scheduler
</code></pre>

<p>......   </p>

<pre><code> Events:
      Type    Reason     Age   From                 Message
      ----    ------     ----  ----                 -------
      Normal  Scheduled  12m   my-scheduler         Successfully assigned default/annotation-second-scheduler to kubemaster
      Normal  Pulled     12m   kubelet, kubemaster  Container image "k8s.gcr.io/pause:2.0" already present on machine
      Normal  Created    12m   kubelet, kubemaster  Created container pod-with-second-annotation-container
      Normal  Started    12m   kubelet, kubemaster  Started container pod-with-second-annotation-container
</code></pre>
