You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/memberagent/main.go
+29-18Lines changed: 29 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -77,21 +77,19 @@ var (
77
77
"Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.")
78
78
leaderElectionNamespace=flag.String("leader-election-namespace", "kube-system", "The namespace in which the leader election resource will be created.")
79
79
// TODO(weiweng): only keep enableV1Alpha1APIs for backward compatibility with helm charts. Remove soon.
80
-
enableV1Alpha1APIs=flag.Bool("enable-v1alpha1-apis", false, "If set, the agents will watch for the v1alpha1 APIs. This is deprecated and will be removed soon.")
81
-
enableV1Beta1APIs=flag.Bool("enable-v1beta1-apis", true, "If set, the agents will watch for the v1beta1 APIs.")
82
-
propertyProvider=flag.String("property-provider", "none", "The property provider to use for the agent.")
83
-
region=flag.String("region", "", "The region where the member cluster resides.")
84
-
cloudConfigFile=flag.String("cloud-config", "/etc/kubernetes/provider/config.json", "The path to the cloud cloudconfig file.")
85
-
watchWorkWithPriorityQueue=flag.Bool("enable-watch-work-with-priority-queue", false, "If set, the apply_work controller will watch/reconcile work objects that are created new or have recent updates")
86
-
watchWorkReconcileAgeMinutes=flag.Int("watch-work-reconcile-age", 60, "maximum age (in minutes) of work objects for apply_work controller to watch/reconcile")
87
-
deletionWaitTime=flag.Int("deletion-wait-time", 5, "The time the work-applier will wait for work object to be deleted before updating the applied work owner reference")
pprofPort=flag.Int("pprof-port", 6065, "port for pprof profiling")
90
-
hubPprofPort=flag.Int("hub-pprof-port", 6066, "port for hub pprof profiling")
91
-
hubQPS=flag.Float64("hub-api-qps", 50, "QPS to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
92
-
hubBurst=flag.Int("hub-api-burst", 500, "Burst to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
93
-
memberQPS=flag.Float64("member-api-qps", 250, "QPS to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
94
-
memberBurst=flag.Int("member-api-burst", 1000, "Burst to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
80
+
enableV1Alpha1APIs=flag.Bool("enable-v1alpha1-apis", false, "If set, the agents will watch for the v1alpha1 APIs. This is deprecated and will be removed soon.")
81
+
enableV1Beta1APIs=flag.Bool("enable-v1beta1-apis", true, "If set, the agents will watch for the v1beta1 APIs.")
82
+
propertyProvider=flag.String("property-provider", "none", "The property provider to use for the agent.")
83
+
region=flag.String("region", "", "The region where the member cluster resides.")
84
+
cloudConfigFile=flag.String("cloud-config", "/etc/kubernetes/provider/config.json", "The path to the cloud cloudconfig file.")
85
+
deletionWaitTime=flag.Int("deletion-wait-time", 5, "The time the work-applier will wait for work object to be deleted before updating the applied work owner reference")
pprofPort=flag.Int("pprof-port", 6065, "port for pprof profiling")
88
+
hubPprofPort=flag.Int("hub-pprof-port", 6066, "port for hub pprof profiling")
89
+
hubQPS=flag.Float64("hub-api-qps", 50, "QPS to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
90
+
hubBurst=flag.Int("hub-api-burst", 500, "Burst to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
91
+
memberQPS=flag.Float64("member-api-qps", 250, "QPS to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
92
+
memberBurst=flag.Int("member-api-burst", 1000, "Burst to use while talking with fleet-apiserver. Doesn't cover events and node heartbeat apis which rate limiting is controlled by a different set of flags.")
95
93
96
94
// Work applier requeue rate limiter settings.
97
95
workApplierRequeueRateLimiterAttemptsWithFixedDelay=flag.Int("work-applier-requeue-rate-limiter-attempts-with-fixed-delay", 1, "If set, the work applier will requeue work objects with a fixed delay for the specified number of attempts before switching to exponential backoff.")
@@ -102,6 +100,12 @@ var (
102
100
workApplierRequeueRateLimiterExponentialBaseForFastBackoff=flag.Float64("work-applier-requeue-rate-limiter-exponential-base-for-fast-backoff", 1.5, "If set, the work applier will start to back off fast at this factor after it completes the slow backoff stage, until it reaches the fast backoff delay cap. Its value should be larger than the base value for the slow backoff stage.")
103
101
workApplierRequeueRateLimiterMaxFastBackoffDelaySeconds=flag.Float64("work-applier-requeue-rate-limiter-max-fast-backoff-delay-seconds", 900, "If set, the work applier will not back off longer than this value in seconds when it is in the fast backoff stage.")
104
102
workApplierRequeueRateLimiterSkipToFastBackoffForAvailableOrDiffReportedWorkObjs=flag.Bool("work-applier-requeue-rate-limiter-skip-to-fast-backoff-for-available-or-diff-reported-work-objs", true, "If set, the rate limiter will skip the slow backoff stage and start fast backoff immediately for work objects that are available or have diff reported.")
103
+
104
+
// Work applier priority queue settings.
105
+
enableWorkApplierPriorityQueue=flag.Bool("enable-work-applier-priority-queue", false, "If set, the work applier will use a priority queue to process work objects.")
106
+
workApplierPriorityLinearEquationCoeffA=flag.Int("work-applier-priority-linear-equation-coeff-a", -3, "The work applier sets the priority for a Work object processing attempt using the linear equation: priority = A * (work object age in minutes) + B. This flag sets the coefficient A in the equation.")
107
+
workApplierPriorityLinearEquationCoeffB=flag.Int("work-applier-priority-linear-equation-coeff-b", 100, "The work applier sets the priority for a Work object processing attempt using the linear equation: priority = A * (work object age in minutes) + B. This flag sets the coefficient B in the equation.")
108
+
105
109
// Azure property provider feature gates.
106
110
isAzProviderCostPropertiesEnabled=flag.Bool("use-cost-properties-in-azure-provider", true, "If set, the Azure property provider will expose cost properties in the member cluster.")
107
111
isAzProviderAvailableResPropertiesEnabled=flag.Bool("use-available-res-properties-in-azure-provider", true, "If set, the Azure property provider will expose available resources properties in the member cluster.")
@@ -133,6 +137,13 @@ func main() {
133
137
klog.ErrorS(errors.New("either enable-v1alpha1-apis or enable-v1beta1-apis is required"), "Invalid APIs flags")
134
138
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
135
139
}
140
+
// TO-DO (chenyu1): refactor the validation logic.
klog.ErrorS(errors.New("parameter workApplierPriorityLinearEquationCoeffA is set incorrectly; must use a value less than 0"), "InvalidFlag", "workApplierPriorityLinearEquationCoeffA")
klog.ErrorS(errors.New("parameter workApplierPriorityLinearEquationCoeffB is set incorrectly; must use a value greater than 0"), "InvalidFlag", "workApplierPriorityLinearEquationCoeffB")
klog.V(2).InfoS("Work object age for prioritized processing is too short; set to the longer default", "workObjAgeForPrioritizedProcessing", woAgeForPrioritizedProcessing)
0 commit comments