File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed
Expand file tree Collapse file tree 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) {
4242
4343 // e2e node tests rely on this
4444 register (global , local , "housekeeping_interval" )
45+ register (global , local , "max_housekeeping_interval" )
4546
4647 // These flags were implicit from cadvisor, and are mistakes that should be registered deprecated:
4748 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
6161const allowDynamicHousekeeping = true
6262
6363func 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+ }
6469 // Override cAdvisor flag defaults.
6570 flagOverrides := map [string ]string {
6671 // Override the default cAdvisor housekeeping interval.
6772 "housekeeping_interval" : defaultHousekeepingInterval .String (),
73+ // Override the default max cAdvisor housekeeping interval.
74+ "max_housekeeping_interval" : maxHouseKeeping ,
6875 // Disable event storage by default.
6976 "event_storage_event_limit" : "default=0" ,
7077 "event_storage_age_limit" : "default=0" ,
Original file line number Diff line number Diff line change @@ -184,10 +184,6 @@ const (
184184 // the cache.
185185 runtimeCacheRefreshPeriod = housekeepingPeriod + housekeepingWarningDuration
186186
187- // Period for performing eviction monitoring.
188- // ensure this is kept in sync with internal cadvisor housekeeping.
189- evictionMonitoringPeriod = time .Second * 10
190-
191187 // The path in containers' filesystems where the hosts file is mounted.
192188 linuxEtcHostsPath = "/etc/hosts"
193189 windowsEtcHostsPath = "C:\\ Windows\\ System32\\ drivers\\ etc\\ hosts"
@@ -264,8 +260,21 @@ var (
264260
265261 // This is exposed for unit tests.
266262 goos = sysruntime .GOOS
263+
264+ // Period for performing eviction monitoring.
265+ // ensure this is kept in sync with internal cadvisor housekeeping.
266+ evictionMonitoringPeriod = time .Second * 10
267267)
268268
269+ func init () {
270+ if value := os .Getenv ("OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION" ); value != "" {
271+ if duration , err := time .ParseDuration (value ); err == nil {
272+ klog .Infof ("Detected OPENSHIFT_EVICTION_MONITORING_PERIOD_DURATION: %v" , value )
273+ evictionMonitoringPeriod = duration
274+ }
275+ }
276+ }
277+
269278func getContainerEtcHostsPath () string {
270279 if goos == "windows" {
271280 return windowsEtcHostsPath
You can’t perform that action at this time.
0 commit comments