If scheduler is not present in kube-system so after adding nodeName in yaml file . . .

Sidd:
If scheduler is not present in kube-system so after adding nodeName in yaml file, will the scheduler show up in kube-system?

Nitin Garg:
Hi @Sidd no I dont think so … infact pod will be auto scheduled on the desired node without scheduler.

Ashok Kumar:
So, there are 2 cases
Case-1
If there is no scheduler present in kube-system and you want to auto schedule your pods then your pods will go into pending state
Case-2
If there is no scheduler present in kube-system and you want to manually schedule a pod with the help of nodeName attribute, yes pod will get assigned to the corresponding node.
Hope that makes sense

Sidd:
@Ashok Kumar Case-2: now will the scheduler show up in kubectl get pods -n kube-system

Sidd:
Because in practice Q was to check why pod was in pending state and solutin was no scheduler present in kube-system. Hence had to manually create a a scheduler now shouldn’t this show in kube-system

Ashok Kumar:
Hey @Sidd
Let me help you understand more clear, so if you do not have scheduler which is default-scheduler then 100% you will not be able to schedule pods even though you have given nodeName on the manifest because someone has to do the scheduling right? And there is no scheduler present on the entire cluster to do the job and that’s why your pod enters into pending state.
For your advanced learning:
If you have your own scheduler on any namespace then it should be explicitly specified on the pod manifest schedulerName: my-scheduler.
And to create one checkout https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/|here

Edit:
On case-2 I meant if no default-scheduler on kube-system then you can assign the pods with your own scheduler and place it on the required node

Sidd:
Thanks, I need to study more about scheduler.