|
|
|
@ -67,29 +67,29 @@ type controllerManager struct {
|
|
|
|
|
sync.Mutex
|
|
|
|
|
started bool
|
|
|
|
|
|
|
|
|
|
stopProcedureEngaged *int64
|
|
|
|
|
errChan chan error
|
|
|
|
|
runnables *runnables
|
|
|
|
|
stopProcedureEngaged *int64 // 已停止程序的计数器
|
|
|
|
|
errChan chan error // 错误通知的管道
|
|
|
|
|
runnables *runnables // 一些 manager 维护的子进程
|
|
|
|
|
|
|
|
|
|
// cluster holds a variety of methods to interact with a cluster. Required.
|
|
|
|
|
cluster cluster.Cluster
|
|
|
|
|
cluster cluster.Cluster // 和 cluster进行通讯的一组方法
|
|
|
|
|
|
|
|
|
|
// recorderProvider is used to generate event recorders that will be injected into Controllers
|
|
|
|
|
// (and EventHandlers, Sources and Predicates).
|
|
|
|
|
recorderProvider *intrec.Provider
|
|
|
|
|
recorderProvider *intrec.Provider // 事件记录器,负责将事件传播出去,包括 events 资源和 log
|
|
|
|
|
|
|
|
|
|
// resourceLock forms the basis for leader election
|
|
|
|
|
resourceLock resourcelock.Interface
|
|
|
|
|
resourceLock resourcelock.Interface // leader 选举过程中的通用方法集,用来锁定任意资源
|
|
|
|
|
|
|
|
|
|
// leaderElectionReleaseOnCancel defines if the manager should step back from the leader lease
|
|
|
|
|
// on shutdown
|
|
|
|
|
leaderElectionReleaseOnCancel bool
|
|
|
|
|
|
|
|
|
|
// metricsListener is used to serve prometheus metrics
|
|
|
|
|
metricsListener net.Listener
|
|
|
|
|
metricsListener net.Listener // 监控的网络访问方法集
|
|
|
|
|
|
|
|
|
|
// metricsExtraHandlers contains extra handlers to register on http server that serves metrics.
|
|
|
|
|
metricsExtraHandlers map[string]http.Handler
|
|
|
|
|
metricsExtraHandlers map[string]http.Handler // 监控的网络访问 handler 映射
|
|
|
|
|
|
|
|
|
|
// healthProbeListener is used to serve liveness probe
|
|
|
|
|
healthProbeListener net.Listener
|
|
|
|
|