Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/machine-healthcheck/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
)

// The default durations for the leader electrion operations.
var (
retryPeriod = 30 * time.Second
renewDealine = 90 * time.Second
)

func printVersion() {
glog.Infof("Go Version: %s", runtime.Version())
glog.Infof("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH)
Expand Down Expand Up @@ -79,6 +85,9 @@ func main() {
LeaderElectionNamespace: *leaderElectResourceNamespace,
LeaderElectionID: "cluster-api-provider-healthcheck-leader",
LeaseDuration: leaderElectLeaseDuration,
// Slow the default retry and renew election rate to reduce etcd writes at idle: BZ 1858400
RetryPeriod: &retryPeriod,
RenewDeadline: &renewDealine,
}

if *watchNamespace != "" {
Expand Down
9 changes: 9 additions & 0 deletions cmd/machineset/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ const (
defaultWebhookCertdir = "/etc/machine-api-operator/tls"
)

// The default durations for the leader electrion operations.
var (
retryPeriod = 30 * time.Second
renewDealine = 90 * time.Second
)

func main() {
flag.Set("logtostderr", "true")
klog.InitFlags(nil)
Expand Down Expand Up @@ -102,6 +108,9 @@ func main() {
LeaderElectionNamespace: *leaderElectResourceNamespace,
LeaderElectionID: "cluster-api-provider-machineset-leader",
LeaseDuration: leaderElectLeaseDuration,
// Slow the default retry and renew election rate to reduce etcd writes at idle: BZ 1858400
RetryPeriod: &retryPeriod,
RenewDeadline: &renewDealine,
}

mgr, err := manager.New(cfg, opts)
Expand Down
9 changes: 9 additions & 0 deletions cmd/nodelink-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
)

// The default durations for the leader electrion operations.
var (
retryPeriod = 30 * time.Second
renewDealine = 90 * time.Second
)

func printVersion() {
klog.Infof("Go Version: %s", runtime.Version())
klog.Infof("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH)
Expand Down Expand Up @@ -65,6 +71,9 @@ func main() {
LeaderElectionNamespace: *leaderElectResourceNamespace,
LeaderElectionID: "cluster-api-provider-nodelink-leader",
LeaseDuration: leaderElectLeaseDuration,
// Slow the default retry and renew election rate to reduce etcd writes at idle: BZ 1858400
RetryPeriod: &retryPeriod,
RenewDeadline: &renewDealine,
}
if *watchNamespace != "" {
opts.Namespace = *watchNamespace
Expand Down
9 changes: 9 additions & 0 deletions cmd/vsphere/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ import (
"sigs.k8s.io/controller-runtime/pkg/runtime/signals"
)

// The default durations for the leader electrion operations.
var (
retryPeriod = 30 * time.Second
renewDealine = 90 * time.Second
)

func main() {
var printVersion bool
flag.BoolVar(&printVersion, "version", false, "print version and exit")
Expand Down Expand Up @@ -79,6 +85,9 @@ func main() {
LeaderElectionNamespace: *leaderElectResourceNamespace,
LeaderElectionID: "cluster-api-provider-vsphere-leader",
LeaseDuration: leaderElectLeaseDuration,
// Slow the default retry and renew election rate to reduce etcd writes at idle: BZ 1858400
RetryPeriod: &retryPeriod,
RenewDeadline: &renewDealine,
}

if *watchNamespace != "" {
Expand Down