Hi, While creating multiple-scheduler i'm getting below error in pod. What would . . .

Manoj GR:
Hi,
While creating multiple-scheduler i’m getting below error in pod.
What would be the issueand why scheduler pod is taking default scheduler port 10259?
Any help would be appreciated :slightly_smiling_face:

I0703 15:19:16.610723       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

Manoj GR:
My scheduler yaml file

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=0
    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: 10251
        scheme: HTTPS
      initialDelaySeconds: 10
      periodSeconds: 10
      timeoutSeconds: 15
    name: kube-scheduler
    resources:
      requests:
        cpu: 100m
    startupProbe:
      failureThreshold: 24
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 10251
        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: {}

Tanumoy Ghosh:
Change the value of port from 0 to something else, it is probably mentioned in the question also

If only changing the port value doesn’t work, try below:

- --port=10279
- --lock-object-name=my-scheduler
- --secure-port=0

Manoj GR:
Worked thanks @Tanumoy Ghosh :slightly_smiling_face:

Tanumoy Ghosh:
Great! did it work only with changing port value or did you need to add the additional parameters ?

Manoj GR:
Along with port changed scheme to HTTP from HTTPS

 startupProbe:
      failureThreshold: 24
      httpGet:
        host: 127.0.0.1
        path: /healthz
        port: 10251
        scheme: HTTP