From d6354a54addb7c3fbfde92a0fc7c2a6d36261a45 Mon Sep 17 00:00:00 2001 From: derekwaynecarr Date: Tue, 10 May 2016 22:05:28 -0400 Subject: [PATCH] Add kubelet flag for eviction max pod grace period --- cmd/kubelet/app/options/options.go | 1 + hack/verify-flags/known-flags.txt | 1 + pkg/apis/componentconfig/types.go | 2 ++ 3 files changed, 4 insertions(+) diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index a58dacac7ba..871e5b21f7d 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -257,4 +257,5 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&s.EvictionSoft, "eviction-soft", s.EvictionSoft, "A set of eviction thresholds (e.g. memory.available<1.5Gi) that if met over a corresponding grace period would trigger a pod eviction.") fs.StringVar(&s.EvictionSoftGracePeriod, "eviction-soft-grace-period", s.EvictionSoftGracePeriod, "A set of eviction grace periods (e.g. memory.available=1m30s) that correspond to how long a soft eviction threshold must hold before triggering a pod eviction.") fs.DurationVar(&s.EvictionPressureTransitionPeriod.Duration, "eviction-pressure-transition-period", s.EvictionPressureTransitionPeriod.Duration, "Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition.") + fs.Int32Var(&s.EvictionMaxPodGracePeriod, "eviction-max-pod-grace-period", s.EvictionMaxPodGracePeriod, "Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met. If negative, defer to pod specified value.") } diff --git a/hack/verify-flags/known-flags.txt b/hack/verify-flags/known-flags.txt index 223ceeadeb6..e8ccd15ef67 100644 --- a/hack/verify-flags/known-flags.txt +++ b/hack/verify-flags/known-flags.txt @@ -122,6 +122,7 @@ eviction-hard eviction-soft eviction-soft-grace-period eviction-pressure-transition-period +eviction-max-pod-grace-period executor-bindall executor-logv executor-path diff --git a/pkg/apis/componentconfig/types.go b/pkg/apis/componentconfig/types.go index ffef22ce0fd..0b1e060de14 100644 --- a/pkg/apis/componentconfig/types.go +++ b/pkg/apis/componentconfig/types.go @@ -351,6 +351,8 @@ type KubeletConfiguration struct { EvictionSoftGracePeriod string `json:"evictionSoftGracePeriod,omitempty"` // Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition. EvictionPressureTransitionPeriod unversioned.Duration `json:"evictionPressureTransitionPeriod,omitempty"` + // Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met. + EvictionMaxPodGracePeriod int32 `json:"evictionMaxPodGracePeriod,omitempty"` } type KubeSchedulerConfiguration struct {