Lock object in kuberenetes

Hi, I was watching the CKA course and come across multiple scheduler video, unfortunately I did not understand what --lock-object-name does in my-custom-scheduler.

@KodeKloud would you please explain it?

It is used to enable leader election. Check this https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/#enable-leader-election
–lock-object-name string Define the name of the lock object. (default “kube-scheduler”) --lock- object-namespace string Define the namespace of the lock object. (default “kube-system”)