Skip to content

Commit

Permalink
Leader election defaults were updated
Browse files Browse the repository at this point in the history
- Leader election now acquires the lock before main begins
- Updated leader election lease duration 15s --> 60s, renewal deadline 10s --> 30s and retry period 2s --> 15s
- Shorter default leader election renewal deadline of 10s causes failure while renewing lease in a network intense cluster
  • Loading branch information
prashanth26 committed Dec 19, 2018
1 parent d156c29 commit bacc72c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/util/client/leaderelectionconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ import (

const (
// DefaultLeaseDuration is the default lease duration for leader election
DefaultLeaseDuration = 15 * time.Second
DefaultLeaseDuration = 60 * time.Second
// DefaultRenewDeadline is the default renew duration for leader election
DefaultRenewDeadline = 10 * time.Second
DefaultRenewDeadline = 30 * time.Second
// DefaultRetryPeriod is the default retry period for leader election
DefaultRetryPeriod = 2 * time.Second
DefaultRetryPeriod = 15 * time.Second
)

// DefaultLeaderElectionConfiguration the default configurations used for leader election
func DefaultLeaderElectionConfiguration() options.LeaderElectionConfiguration {
return options.LeaderElectionConfiguration{
LeaderElect: false,
LeaderElect: true,
LeaseDuration: metav1.Duration{Duration: DefaultLeaseDuration},
RenewDeadline: metav1.Duration{Duration: DefaultRenewDeadline},
RetryPeriod: metav1.Duration{Duration: DefaultRetryPeriod},
Expand Down

0 comments on commit bacc72c

Please sign in to comment.