Hello, In the multiple scheduler lab I'm getting error while creating custom sch . . .

Sunit Shukla:
Hello,
In the multiple scheduler lab I’m getting error while creating custom scheduler - its giving crashloopbackoff error.
Error in the the event section of kubectl describe command:
Warning BackOff 16s (x25 over 5m11s) kubelet Back-off restarting failed container

Can anyone suggest what I’m missing here.
Here’s the config file I’m using to deploy custom-scheduler
cat my-scheduler.yaml

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=true
    - --scheduler-name=my-scheduler  
    - --port=81
    image: <http://k8s.gcr.io/kube-scheduler:v1.20.0|k8s.gcr.io/kube-scheduler:v1.20.0>
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 8
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 10259
        scheme: HTTPS
      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: 10259
        scheme: HTTPS
      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
status: {}

Fernando Jimenez:
Doesn’t say anything about not able to bind the ip address at port 10259?
Give it a try by changing the following parameters.

 - --leader-elect=false
 - --port=0
 - --secure-port=10280

Now, change any mention of port: 10259 to port: 10280

Sunit Shukla:
it worked. I did try changing the ports before. Only thing that I missed - was adding --secure-port option. Thanks!