pod in pending state with custom scheduler

Hi Guys,

This might be silly. But, Just wondering why the pod is in pending state even after killing the remaining containers so that nodes have enough capacity. 

I am working on Excercise: MultipleSchedulers and not sure if I am missing anything, Also, how to see all the schedulers available?

After  reading the documentation fro k8s.io, It looks like we have to create a custom scheduler and then add it to the cluster binding and then it will schedule the pod. Otherwise, pod will be always in pending state. Please let me know your thoughts.

  • post-author-pic
    Chad C

    Hey Rajesh, I think its because you haven't enabled the CNI. 

    Try this:
    sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

  • post-author-pic
    Rajesh P

    Hi Chad - It didn't work. See the output below.

    [sudo] password for cloud_user: 
    clusterrole.rbac.authorization.k8s.io/flannel unchanged
    clusterrolebinding.rbac.authorization.k8s.io/flannel unchanged
    serviceaccount/flannel unchanged
    configmap/kube-flannel-cfg unchanged
    daemonset.extensions/kube-flannel-ds-amd64 unchanged
    daemonset.extensions/kube-flannel-ds-arm64 unchanged
    daemonset.extensions/kube-flannel-ds-arm unchanged
    daemonset.extensions/kube-flannel-ds-ppc64le unchanged
    daemonset.extensions/kube-flannel-ds-s390x unchanged

    Here the pods I have.

    cloud_user@rpotru1c:~$ kubectl apply -f scheduler.yaml 
    pod/annotation-custom-scheduler unchanged
    cloud_user@rpotru1c:~$ kubectl get pods
    annotation-custom-scheduler 0/1 Pending 0 9h
    counter1 1/1 Running 1 9h
    env-demo 0/1 Completed 0 17h
    lots-of-nothing-567bb7c6b4-bcspt 1/1 Running 1 8h
    lots-of-nothing-567bb7c6b4-rtwmf 1/1 Running 1 8h
    lots-of-nothing-567bb7c6b4-wnwnv 1/1 Running 1 8h

    Here is the yaml i have applied.

    apiVersion: v1
    kind: Pod
    name: annotation-custom-scheduler
    name: multischeduler
    schedulerName: custom-scheduler
    - name: pod-container
    image: k8s.gcr.io/pause:2.0

  • post-author-pic
    Xiaodong Y

    I think it makes sense the pod is in pending since custom-scheduler don't exist at all.

Looking For Team Training?

Learn More