Can someone advise me what I might be doing wrong here , In multiple scheduler l . . .

Bukola:
Can someone advise me what I might be doing wrong here , In multiple scheduler lab
What is expected by the custom scheduler name ? I assume it means to use name: my-scheduler

Here is my manifest that I used to apply it and the pod is running but something else is missing why it is marked wrong

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    component: my-scheduler
    tier: control-plane
  name: my-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
    - --kubeconfig=/etc/kubernetes/scheduler.conf
    - --leader-elect=false
    - --port=22600
    image: <http://k8s.gcr.io/kube-scheduler:v1.19.0|k8s.gcr.io/kube-scheduler:v1.19.0>
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 8
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 22600
        scheme: HTTP
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 15
    name: my-scheduler
    resources:
      requests:
        cpu: 100m
    startupProbe:
      failureThreshold: 24
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 22600
        scheme: HTTP
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 15
    volumeMounts:
    - mountPath: /etc/kubernetes/scheduler.conf
      name: kubeconfig
      readOnly: true
  hostNetwork: true
  priorityClassName: system-node-critical
  volumes:
  - hostPath:
      path: /etc/kubernetes/scheduler.conf
      type: FileOrCreate
    name: kubeconfig

Mohamed Ayman:
Try to deploy the custom scheduler using kubectl apply not static POD.

Mohamed Ayman:
Check the answer at /var/answers path in the environment:
kubectl apply -f /var/answers/my-scheduler.yaml

Bukola:
Yes I deployed it with kubectl apply , I moved the file to root , edited it and applied

Bukola:
I also checked the answer file and I still cant figure out what is wrong

Bukola:
What does custom scheduler name ( being marked wrong) mean if I may ask

Bukola:
The difference between my file and the answer file is the image tag , and the instruction was to use the manifest deployed by kubeadm ( which is what I did)
The 2nd difference i noticed is the name of the container , in the answer file , it used kube-scheduler , while I used my-scheduler ( I do not think this is the issue though because I tried it both ways )

Bukola:
And applying the answer file works and marked correctly . @Mohamed Ayman if you have sometime , could you check my manifest and point me to what might be wrong . Thanks

Craig Shea:
I have an answer for you. Give me a second to post some links to my solution that works…

Craig Shea:
My solution uses a manifest, as described by the lab. The only thing is question 3 didn’t recognize the working my-scheduler scheduler. BUT, it IS working. Question 4 will be just fine. I encourage you to read the thread (not sure if linking to one thread message links in the entire thread, so posting all links to my replies outlining the solution. The 2nd-to-last link is my YAML file that contains everything for a working solution.) Here are the links:
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614446725264300?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614446983264500?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614447432265600?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614447662265800?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614447699266000?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614447699266200?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV
https://kodekloud.slack.com/archives/CHMV3P9NV/p1614447994266400?thread_ts=1613871659.027900&amp;cid=CHMV3P9NV

Rocky:
Thank you @Craig Shea! secure-port=o takes random port is a discovery; I pulled my hair while doing it and then just used http & port instead of https & secure-port to get through the question.

Craig Shea:
I think, according to what I read, that the service used to use an unsecured port (i.e. only the --port parameter). But it has since changed. I already submitted feedback about this lab that it needs some serious updating since the days of k8s 1.16-1.18. I’m glad I was able to help!!

Bukola:
Thanks @Craig Shea I have gone through your thread, so you are saying your lab also was not marked as correct after you did all of these?

Bukola:
Because I also used my scheduler which was not marked as correct in the next question and it worked . Of course because the scheduler pod was actually running

Bukola:
But my curiosity is that the answer file gets marked correctly and I cant still spot the difference between my manifest and the answer file

Craig Shea:
@Bukola So after going through my steps, question 3 will not be detected as correct, so I’m forced to skip past the question. However, as you also saw, it is possible to schedule a pod using that scheduler, and so question 4 is detected as correct. I think the short answer here is that the lab was originally written against an earlier version of k8s. I had taken that lab a few months ago, and the provided answer was the correct solution at the time. What’s different here, is that since this lab was originally written, k8s has switched to using TLS for all scheduler communications–whereas before, this communication was in plaintext over HTTP. That, I think, is where the ultimate failing is at with the lab’s answer. When not using a secure port (--secure-port), the scheduler won’t start. (There may be some option you can pass to override that behavior, but since that’s insecure, I wanted to find a solution that also used TLS protected communications between the kube-api and the scheduler.)

Bukola:
Yes @Craig Shea I noticed in the answerfile it uses http , I was initially using https , but when it was failing i changed it to http and the pod then came up

Bukola:
but I also needed to add --secure-port=0 and --port=10257 else it wont come up and it fails with some liveliness probe failure

Bukola:
I think I found it , I found the missing item hahahahaha . I just compared my answer with the answerfile now and noticed that answerfile has this --scheduler-name=my-scheduler in the command section , which i think explains why it doesnt mark it for me as correct . Am going to try it now and revert

Bukola:
yay , that was it . :joy: Interesting!!!