From c2911906745311f8ea1a7f91adab2d0abcd7b826 Mon Sep 17 00:00:00 2001 From: Ciprian Hacman Date: Sat, 26 Aug 2023 06:01:27 +0300 Subject: [PATCH] Add support for --experimental-allocatable-ignore-eviction kubelet flag --- k8s/crds/kops.k8s.io_clusters.yaml | 8 ++++++++ k8s/crds/kops.k8s.io_instancegroups.yaml | 4 ++++ pkg/apis/kops/componentconfig.go | 2 ++ pkg/apis/kops/v1alpha2/componentconfig.go | 2 ++ pkg/apis/kops/v1alpha2/zz_generated.conversion.go | 2 ++ pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go | 5 +++++ pkg/apis/kops/v1alpha3/componentconfig.go | 2 ++ pkg/apis/kops/v1alpha3/zz_generated.conversion.go | 2 ++ pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go | 5 +++++ pkg/apis/kops/zz_generated.deepcopy.go | 5 +++++ 10 files changed, 37 insertions(+) diff --git a/k8s/crds/kops.k8s.io_clusters.yaml b/k8s/crds/kops.k8s.io_clusters.yaml index 31a044388d..57c0e803b7 100644 --- a/k8s/crds/kops.k8s.io_clusters.yaml +++ b/k8s/crds/kops.k8s.io_clusters.yaml @@ -3741,6 +3741,10 @@ spec: description: Comma-delimited list of grace periods for each soft eviction signal. For example, 'memory.available=30s'. type: string + experimentalAllocatableIgnoreEviction: + description: ExperimentalAllocatableIgnoreEviction enables ignoring + Hard Eviction Thresholds while calculating Node Allocatable + type: boolean experimentalAllowedUnsafeSysctls: description: ExperimentalAllowedUnsafeSysctls are passed to the kubelet config to whitelist allowable sysctls Was promoted to @@ -4174,6 +4178,10 @@ spec: description: Comma-delimited list of grace periods for each soft eviction signal. For example, 'memory.available=30s'. type: string + experimentalAllocatableIgnoreEviction: + description: ExperimentalAllocatableIgnoreEviction enables ignoring + Hard Eviction Thresholds while calculating Node Allocatable + type: boolean experimentalAllowedUnsafeSysctls: description: ExperimentalAllowedUnsafeSysctls are passed to the kubelet config to whitelist allowable sysctls Was promoted to diff --git a/k8s/crds/kops.k8s.io_instancegroups.yaml b/k8s/crds/kops.k8s.io_instancegroups.yaml index 473e80a332..8f9e4f2078 100644 --- a/k8s/crds/kops.k8s.io_instancegroups.yaml +++ b/k8s/crds/kops.k8s.io_instancegroups.yaml @@ -534,6 +534,10 @@ spec: description: Comma-delimited list of grace periods for each soft eviction signal. For example, 'memory.available=30s'. type: string + experimentalAllocatableIgnoreEviction: + description: ExperimentalAllocatableIgnoreEviction enables ignoring + Hard Eviction Thresholds while calculating Node Allocatable + type: boolean experimentalAllowedUnsafeSysctls: description: ExperimentalAllowedUnsafeSysctls are passed to the kubelet config to whitelist allowable sysctls Was promoted to diff --git a/pkg/apis/kops/componentconfig.go b/pkg/apis/kops/componentconfig.go index 1c7562d749..3406b1c619 100644 --- a/pkg/apis/kops/componentconfig.go +++ b/pkg/apis/kops/componentconfig.go @@ -225,6 +225,8 @@ type KubeletConfigSpec struct { EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"` // PodPidsLimit is the maximum number of pids in any pod. PodPidsLimit *int64 `json:"podPidsLimit,omitempty" flag:"pod-max-pids"` + // ExperimentalAllocatableIgnoreEviction enables ignoring Hard Eviction Thresholds while calculating Node Allocatable + ExperimentalAllocatableIgnoreEviction *bool `json:"experimentalAllocatableIgnoreEviction,omitempty" flag:"experimental-allocatable-ignore-eviction"` // ShutdownGracePeriod specifies the total duration that the node should delay the shutdown by. // Default: 30s diff --git a/pkg/apis/kops/v1alpha2/componentconfig.go b/pkg/apis/kops/v1alpha2/componentconfig.go index 9cb6522b0a..8115ce7bf7 100644 --- a/pkg/apis/kops/v1alpha2/componentconfig.go +++ b/pkg/apis/kops/v1alpha2/componentconfig.go @@ -225,6 +225,8 @@ type KubeletConfigSpec struct { EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"` // PodPidsLimit is the maximum number of pids in any pod. PodPidsLimit *int64 `json:"podPidsLimit,omitempty" flag:"pod-max-pids"` + // ExperimentalAllocatableIgnoreEviction enables ignoring Hard Eviction Thresholds while calculating Node Allocatable + ExperimentalAllocatableIgnoreEviction *bool `json:"experimentalAllocatableIgnoreEviction,omitempty" flag:"experimental-allocatable-ignore-eviction"` // ShutdownGracePeriod specifies the total duration that the node should delay the shutdown by. // Default: 30s diff --git a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go index 5a2c089fd4..5945ee4e67 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.conversion.go @@ -5397,6 +5397,7 @@ func autoConvert_v1alpha2_KubeletConfigSpec_To_kops_KubeletConfigSpec(in *Kubele out.ContainerLogMaxFiles = in.ContainerLogMaxFiles out.EnableCadvisorJsonEndpoints = in.EnableCadvisorJsonEndpoints out.PodPidsLimit = in.PodPidsLimit + out.ExperimentalAllocatableIgnoreEviction = in.ExperimentalAllocatableIgnoreEviction out.ShutdownGracePeriod = in.ShutdownGracePeriod out.ShutdownGracePeriodCriticalPods = in.ShutdownGracePeriodCriticalPods out.MemorySwapBehavior = in.MemorySwapBehavior @@ -5497,6 +5498,7 @@ func autoConvert_kops_KubeletConfigSpec_To_v1alpha2_KubeletConfigSpec(in *kops.K out.ContainerLogMaxFiles = in.ContainerLogMaxFiles out.EnableCadvisorJsonEndpoints = in.EnableCadvisorJsonEndpoints out.PodPidsLimit = in.PodPidsLimit + out.ExperimentalAllocatableIgnoreEviction = in.ExperimentalAllocatableIgnoreEviction out.ShutdownGracePeriod = in.ShutdownGracePeriod out.ShutdownGracePeriodCriticalPods = in.ShutdownGracePeriodCriticalPods out.MemorySwapBehavior = in.MemorySwapBehavior diff --git a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go index 176ddef863..0a80395678 100644 --- a/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go @@ -3945,6 +3945,11 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) { *out = new(int64) **out = **in } + if in.ExperimentalAllocatableIgnoreEviction != nil { + in, out := &in.ExperimentalAllocatableIgnoreEviction, &out.ExperimentalAllocatableIgnoreEviction + *out = new(bool) + **out = **in + } if in.ShutdownGracePeriod != nil { in, out := &in.ShutdownGracePeriod, &out.ShutdownGracePeriod *out = new(v1.Duration) diff --git a/pkg/apis/kops/v1alpha3/componentconfig.go b/pkg/apis/kops/v1alpha3/componentconfig.go index f33bd3a6f5..ff63ca1119 100644 --- a/pkg/apis/kops/v1alpha3/componentconfig.go +++ b/pkg/apis/kops/v1alpha3/componentconfig.go @@ -223,6 +223,8 @@ type KubeletConfigSpec struct { EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"` // PodPidsLimit is the maximum number of pids in any pod. PodPidsLimit *int64 `json:"podPidsLimit,omitempty" flag:"pod-max-pids"` + // ExperimentalAllocatableIgnoreEviction enables ignoring Hard Eviction Thresholds while calculating Node Allocatable + ExperimentalAllocatableIgnoreEviction *bool `json:"experimentalAllocatableIgnoreEviction,omitempty" flag:"experimental-allocatable-ignore-eviction"` // ShutdownGracePeriod specifies the total duration that the node should delay the shutdown by. // Default: 30s diff --git a/pkg/apis/kops/v1alpha3/zz_generated.conversion.go b/pkg/apis/kops/v1alpha3/zz_generated.conversion.go index 9bbe06fdbf..9038ad3f7a 100644 --- a/pkg/apis/kops/v1alpha3/zz_generated.conversion.go +++ b/pkg/apis/kops/v1alpha3/zz_generated.conversion.go @@ -5788,6 +5788,7 @@ func autoConvert_v1alpha3_KubeletConfigSpec_To_kops_KubeletConfigSpec(in *Kubele out.ContainerLogMaxFiles = in.ContainerLogMaxFiles out.EnableCadvisorJsonEndpoints = in.EnableCadvisorJsonEndpoints out.PodPidsLimit = in.PodPidsLimit + out.ExperimentalAllocatableIgnoreEviction = in.ExperimentalAllocatableIgnoreEviction out.ShutdownGracePeriod = in.ShutdownGracePeriod out.ShutdownGracePeriodCriticalPods = in.ShutdownGracePeriodCriticalPods out.MemorySwapBehavior = in.MemorySwapBehavior @@ -5888,6 +5889,7 @@ func autoConvert_kops_KubeletConfigSpec_To_v1alpha3_KubeletConfigSpec(in *kops.K out.ContainerLogMaxFiles = in.ContainerLogMaxFiles out.EnableCadvisorJsonEndpoints = in.EnableCadvisorJsonEndpoints out.PodPidsLimit = in.PodPidsLimit + out.ExperimentalAllocatableIgnoreEviction = in.ExperimentalAllocatableIgnoreEviction out.ShutdownGracePeriod = in.ShutdownGracePeriod out.ShutdownGracePeriodCriticalPods = in.ShutdownGracePeriodCriticalPods out.MemorySwapBehavior = in.MemorySwapBehavior diff --git a/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go index 7bb949e940..b34c57ff29 100644 --- a/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go @@ -3914,6 +3914,11 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) { *out = new(int64) **out = **in } + if in.ExperimentalAllocatableIgnoreEviction != nil { + in, out := &in.ExperimentalAllocatableIgnoreEviction, &out.ExperimentalAllocatableIgnoreEviction + *out = new(bool) + **out = **in + } if in.ShutdownGracePeriod != nil { in, out := &in.ShutdownGracePeriod, &out.ShutdownGracePeriod *out = new(v1.Duration) diff --git a/pkg/apis/kops/zz_generated.deepcopy.go b/pkg/apis/kops/zz_generated.deepcopy.go index 0dce3dedc5..d04d578cdd 100644 --- a/pkg/apis/kops/zz_generated.deepcopy.go +++ b/pkg/apis/kops/zz_generated.deepcopy.go @@ -4093,6 +4093,11 @@ func (in *KubeletConfigSpec) DeepCopyInto(out *KubeletConfigSpec) { *out = new(int64) **out = **in } + if in.ExperimentalAllocatableIgnoreEviction != nil { + in, out := &in.ExperimentalAllocatableIgnoreEviction, &out.ExperimentalAllocatableIgnoreEviction + *out = new(bool) + **out = **in + } if in.ShutdownGracePeriod != nil { in, out := &in.ShutdownGracePeriod, &out.ShutdownGracePeriod *out = new(v1.Duration)