File tree 3 files changed +21
-4
lines changed
3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ func addCadvisorFlags(fs *pflag.FlagSet) {
42
42
43
43
// e2e node tests rely on this
44
44
register (global , local , "housekeeping_interval" )
45
+ register (global , local , "max_housekeeping_interval" )
45
46
46
47
// These flags were implicit from cadvisor, and are mistakes that should be registered deprecated:
47
48
const deprecated = "This is a cadvisor flag that was mistakenly registered with the Kubelet. Due to legacy concerns, it will follow the standard CLI deprecation timeline before being removed."
Original file line number Diff line number Diff line change @@ -61,10 +61,17 @@ const defaultHousekeepingInterval = 10 * time.Second
61
61
const allowDynamicHousekeeping = true
62
62
63
63
func init () {
64
+ maxHouseKeeping := maxHousekeepingInterval .String ()
65
+ if value := os .Getenv ("OPENSHIFT_MAX_HOUSEKEEPING_INTERVAL_DURATION" ); value != "" {
66
+ klog .Infof ("Detected OPENSHIFT_MAX_HOUSEKEEPING_INTERVAL_DURATION: %v" , value )
67
+ maxHouseKeeping = value
68
+ }
64
69
// Override cAdvisor flag defaults.
65
70
flagOverrides := map [string ]string {
66
71
// Override the default cAdvisor housekeeping interval.
67
72
"housekeeping_interval" : defaultHousekeepingInterval .String (),
73
+ // Override the default max cAdvisor housekeeping interval.
74
+ "max_housekeeping_interval" : maxHouseKeeping ,
68
75
// Disable event storage by default.
69
76
"event_storage_event_limit" : "default=0" ,
70
77
"event_storage_age_limit" : "default=0" ,
Original file line number Diff line number Diff line change @@ -185,10 +185,6 @@ const (
185
185
// the cache.
186
186
runtimeCacheRefreshPeriod = housekeepingPeriod + housekeepingWarningDuration
187
187
188
- // Period for performing eviction monitoring.
189
- // ensure this is kept in sync with internal cadvisor housekeeping.
190
- evictionMonitoringPeriod = time .Second * 10
191
-
192
188
// The path in containers' filesystems where the hosts file is mounted.
193
189
linuxEtcHostsPath = "/etc/hosts"
194
190
windowsEtcHostsPath = "C:\\ Windows\\ System32\\ drivers\\ etc\\ hosts"
@@ -263,8 +259,21 @@ var (
263
259
264
260
// This is exposed for unit tests.
265
261
goos = sysruntime .GOOS
262
+
263
+ // Period for performing eviction monitoring.
264
+ // ensure this is kept in sync with internal cadvisor housekeeping.
265
+ evictionMonitoringPeriod = time .Second * 10
266
266
)
267
267
268
+ func init () {
269
+ if value := os .Getenv ("OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION" ); value != "" {
270
+ if duration , err := time .ParseDuration (value ); err == nil {
271
+ klog .Infof ("Detected OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION: %v" , value )
272
+ evictionMonitoringPeriod = duration
273
+ }
274
+ }
275
+ }
276
+
268
277
func getContainerEtcHostsPath () string {
269
278
if goos == "windows" {
270
279
return windowsEtcHostsPath
You can’t perform that action at this time.
0 commit comments