leaderelection

package
v0.0.0-...-52527b8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LeaderElectionDefaulting

func LeaderElectionDefaulting(config configv1.LeaderElection, defaultNamespace, defaultName string) configv1.LeaderElection

LeaderElectionDefaulting applies what we think are reasonable defaults. It does not mutate the original. We do defaulting outside the API so that we can change over time and know whether the user intended to override our values as opposed to simply getting the defaulted serialization at some point.

func LeaderElectionSNOConfig

func LeaderElectionSNOConfig(config configv1.LeaderElection) configv1.LeaderElection

LeaderElectionSNOConfig uses the formula derived in LeaderElectionDefaulting with increased retry period and lease duration for SNO clusters that have limited resources. This method does not respect the passed in LeaderElection config and the returned object will have values that are overridden with SNO environments in mind. This method should only be called when running in an SNO Cluster.

func ToLeaderElectionWithLease

func ToLeaderElectionWithLease(clientConfig *rest.Config, config configv1.LeaderElection, component, identity string) (leaderelection.LeaderElectionConfig, error)

ToLeaderElectionWithLease returns a "leases" based leader election config that you just need to fill in the Callback for. NOTE: we had switched from "configmaps" to "configmapsleases" to give an opportunity for the operators to migrate in a backward compatible way. The final step in the migration is switch to using Leases. See https://github.com/kubernetes/kubernetes/issues/107454 for details on how to migrate to "leases" leader election.

Don't forget the callbacks!

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL