k8s v1.19.0
kube-controller-manager加分布式锁lease,完成leader选举,与kube-scheduler相同。
holder是主机名+uuid
cmd/kube-controller-manager/app/controllermanager.go
Run函数
staging/src/k8s.io/component-base/config/options/leaderelectionconfig.go
BindLeaderElectionFlags函数
绑定leader选举参数
--leader-elect-lease-duration选举后任期默认值是15s
--leader-elect-renew-deadline续约请求超时时间默认值是10s
--leader-elect-retry-period续约间隔或者抢锁间隔默认值是2s