Practice test- multiple schedulers

Hello,

I have a question. I accidentally created the my-scheduler.yaml in the /root directory and then moved it to the /etc/kubernetes/manifests . The pod was not able to start there:

controlplane $ kubectl logs my-scheduler-controlplane -n kube-system
I0514 11:27:15.883380 1 registry.go:173] Registering SelectorSpread plugin
I0514 11:27:15.883518 1 registry.go:173] Registering SelectorSpread plugin
I0514 11:27:16.152521 1 serving.go:331] Generated self-signed cert in-memory
failed to create listener: failed to listen on 127.0.0.1:10259: listen tcp 127.0.0.1:10259: bind: address already in use

Can you explain why please?

Why it has a conflict with the already created kube-scheduler-controlplane?

Besides I changed the port

apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
component: kube-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
    • –scheduler-name=my-scheduler
    • –port=10251
      image: k8s.gcr.io/kube-scheduler:v1.19.0
      imagePullPolicy: IfNotPresent
      livenessProbe:
      failureThreshold: 8
      httpGet:
      host: 127.0.0.1
      path: /healthz
      port: 10251
      scheme: HTTPS

Kindly deploy It as a POD, not static POD. simply deploy It using this command:

kubectl apply -f /var/answers/my-scheduler.yaml

Noting that the two methods are OK but the lab validates only one answer so to pass the exam will need to deploy It as a normal POD.

1 Like