package leaderelection
import "k8s.io/kubernetes/pkg/controlplane/controller/leaderelection"
Index ¶
- Variables
- func RunWithLeaderElection(ctx context.Context, config *rest.Config, newRunnerFn NewRunner)
- type Controller
- func NewController(leaseInformer coordinationv1informers.LeaseInformer, leaseCandidateInformer coordinationv1alpha2.LeaseCandidateInformer, leaseClient coordinationv1client.CoordinationV1Interface, leaseCandidateClient coordinationv1alpha2client.CoordinationV1alpha2Interface) (*Controller, error)
- func (c *Controller) Run(ctx context.Context, workers int)
- type LeaseCandidateGCController
- func NewLeaseCandidateGC(clientset kubernetes.Interface, gcCheckPeriod time.Duration, leaseCandidateInformer coordinationv1alpha2informers.LeaseCandidateInformer) *LeaseCandidateGCController
- func (c *LeaseCandidateGCController) Run(ctx context.Context)
- type NewRunner
Variables ¶
var ( // TODO: Eventually these should be configurable LeaseDuration = 15 * time.Second RenewDeadline = 10 * time.Second RetryPeriod = 2 * time.Second )
Functions ¶
func RunWithLeaderElection ¶
RunWithLeaderElection runs the provided runner function with leader election. newRunnerFn might be called multiple times, and it should return another controller instance's Run method each time. RunWithLeaderElection only returns when the context is done, or initial leader election fails.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the leader election controller, which observes component identity leases for components that have self-nominated as candidate leaders for leases and elects leaders for those leases, favoring candidates with higher versions.
func NewController ¶
func NewController(leaseInformer coordinationv1informers.LeaseInformer, leaseCandidateInformer coordinationv1alpha2.LeaseCandidateInformer, leaseClient coordinationv1client.CoordinationV1Interface, leaseCandidateClient coordinationv1alpha2client.CoordinationV1alpha2Interface) (*Controller, error)
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context, workers int)
type LeaseCandidateGCController ¶
type LeaseCandidateGCController struct {
// contains filtered or unexported fields
}
func NewLeaseCandidateGC ¶
func NewLeaseCandidateGC(clientset kubernetes.Interface, gcCheckPeriod time.Duration, leaseCandidateInformer coordinationv1alpha2informers.LeaseCandidateInformer) *LeaseCandidateGCController
NewLeaseCandidateGC creates a new LeaseCandidateGCController.
func (*LeaseCandidateGCController) Run ¶
func (c *LeaseCandidateGCController) Run(ctx context.Context)
Run starts one worker.
type NewRunner ¶
Source Files ¶
election.go leaderelection_controller.go leasecandidategc_controller.go run_with_leaderelection.go
- Version
- v1.32.3
- Published
- Mar 11, 2025
- Platform
- js/wasm
- Imports
- 29 packages
- Last checked
- 11 minutes ago –
Tools for package owners.