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 @@ -59,10 +59,17 @@ const defaultHousekeepingInterval = 10 * time.Second
59
59
const allowDynamicHousekeeping = true
60
60
61
61
func init () {
62
+ maxHouseKeeping := maxHousekeepingInterval .String ()
63
+ if value := os .Getenv ("OPENSHIFT_MAX_HOUSEKEEPING_INTERVAL_DURATION" ); value != "" {
64
+ klog .Infof ("Detected OPENSHIFT_MAX_HOUSEKEEPING_INTERVAL_DURATION: %v" , value )
65
+ maxHouseKeeping = value
66
+ }
62
67
// Override cAdvisor flag defaults.
63
68
flagOverrides := map [string ]string {
64
69
// Override the default cAdvisor housekeeping interval.
65
70
"housekeeping_interval" : defaultHousekeepingInterval .String (),
71
+ // Override the default max cAdvisor housekeeping interval.
72
+ "max_housekeeping_interval" : maxHouseKeeping ,
66
73
// Disable event storage by default.
67
74
"event_storage_event_limit" : "default=0" ,
68
75
"event_storage_age_limit" : "default=0" ,
Original file line number Diff line number Diff line change @@ -171,10 +171,6 @@ const (
171
171
// the cache.
172
172
runtimeCacheRefreshPeriod = housekeepingPeriod + housekeepingWarningDuration
173
173
174
- // Period for performing eviction monitoring.
175
- // ensure this is kept in sync with internal cadvisor housekeeping.
176
- evictionMonitoringPeriod = time .Second * 10
177
-
178
174
// The path in containers' filesystems where the hosts file is mounted.
179
175
linuxEtcHostsPath = "/etc/hosts"
180
176
windowsEtcHostsPath = "C:\\ Windows\\ System32\\ drivers\\ etc\\ hosts"
@@ -251,8 +247,21 @@ var (
251
247
252
248
// This is exposed for unit tests.
253
249
goos = sysruntime .GOOS
250
+
251
+ // Period for performing eviction monitoring.
252
+ // ensure this is kept in sync with internal cadvisor housekeeping.
253
+ evictionMonitoringPeriod = time .Second * 10
254
254
)
255
255
256
+ func init () {
257
+ if value := os .Getenv ("OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION" ); value != "" {
258
+ if duration , err := time .ParseDuration (value ); err == nil {
259
+ klog .Infof ("Detected OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION: %v" , value )
260
+ evictionMonitoringPeriod = duration
261
+ }
262
+ }
263
+ }
264
+
256
265
func getContainerEtcHostsPath () string {
257
266
if goos == "windows" {
258
267
return windowsEtcHostsPath
You can’t perform that action at this time.
0 commit comments