Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions templates/cmd/controller/main.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
ctrlrt "sigs.k8s.io/controller-runtime"
ctrlrtcache "sigs.k8s.io/controller-runtime/pkg/cache"
ctrlrtconfig "sigs.k8s.io/controller-runtime/pkg/config"
ctrlrthealthz "sigs.k8s.io/controller-runtime/pkg/healthz"
ctrlrtmetrics "sigs.k8s.io/controller-runtime/pkg/metrics"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
Expand Down Expand Up @@ -128,6 +129,11 @@ func main() {
Host: host,
},
},
Controller: ctrlrtconfig.Controller{
// EnableWarmup allows controllers to start their sources (watches/informers) before
// leader election is won. This pre-populates caches and improves leader failover time.
EnableWarmup: &ackCfg.EnableControllerWarmup,
},
Metrics: metricsserver.Options{BindAddress: ackCfg.MetricsAddr},
LeaderElection: ackCfg.EnableLeaderElection,
LeaderElectionID: "ack-" + awsServiceAPIGroup,
Expand Down
3 changes: 3 additions & 0 deletions templates/helm/templates/deployment.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ spec:
- --enable-leader-election
- --leader-election-namespace
- "$(LEADER_ELECTION_NAMESPACE)"
{{ "{{- if .Values.leaderElection.enableControllerWarmup }}" }}
- --enable-controller-warmup
{{ "{{- end }}" }}
{{ "{{- end }}" }}
{{ "{{- if gt (int .Values.reconcile.defaultResyncPeriod) 0 }}" }}
- --reconcile-default-resync-seconds
Expand Down
4 changes: 4 additions & 0 deletions templates/helm/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,10 @@ leaderElection:
# will attempt to use the namespace of the service account mounted to the Controller
# pod.
namespace: ""
# Enable controller warmup to start controller sources (watches/informers) before
# leader election is won. This pre-populates caches and improves leader failover time.
# Requires leader election to be enabled.
enableControllerWarmup: false

# Enable Cross Account Resource Management (default = true). Set this to false to disable cross account resource management.
enableCARM: true
Expand Down