Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add bottlerocket support for kubeletconfiguration evictionsoft #6760

Closed
3 changes: 3 additions & 0 deletions pkg/providers/amifamily/bootstrap/bottlerocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ func (b Bottlerocket) Script() (string, error) {
if b.KubeletConfig.EvictionHard != nil {
anandg112 marked this conversation as resolved.
Show resolved Hide resolved
s.Settings.Kubernetes.EvictionHard = b.KubeletConfig.EvictionHard
}
if b.KubeletConfig.EvictionSoft != nil {
s.Settings.Kubernetes.EvictionSoft = b.KubeletConfig.EvictionSoft
}
if b.KubeletConfig.ImageGCHighThresholdPercent != nil {
s.Settings.Kubernetes.ImageGCHighThresholdPercent = lo.ToPtr(strconv.FormatInt(int64(*b.KubeletConfig.ImageGCHighThresholdPercent), 10))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type BottlerocketKubernetes struct {
MaxPods *int `toml:"max-pods,omitempty"`
StaticPods map[string]BottlerocketStaticPod `toml:"static-pods,omitempty"`
EvictionHard map[string]string `toml:"eviction-hard,omitempty"`
EvictionSoft map[string]string `toml:"eviction-soft,omitempty"`
KubeReserved map[string]string `toml:"kube-reserved,omitempty"`
SystemReserved map[string]string `toml:"system-reserved,omitempty"`
AllowedUnsafeSysctls []string `toml:"allowed-unsafe-sysctls,omitempty"`
Expand Down
1 change: 0 additions & 1 deletion pkg/providers/amifamily/bottlerocket.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func (b Bottlerocket) FeatureFlags() FeatureFlags {
return FeatureFlags{
UsesENILimitedMemoryOverhead: false,
PodsPerCoreEnabled: false,
EvictionSoftEnabled: false,
SupportsENILimitedPodDensity: true,
}
}
1 change: 1 addition & 0 deletions test/suites/ami/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ var _ = Describe("AMI", func() {
actualUserData, err := base64.StdEncoding.DecodeString(*getInstanceAttribute(pod.Spec.NodeName, "userData").UserData.Value)
Expect(err).ToNot(HaveOccurred())
Expect(string(actualUserData)).To(ContainSubstring("kube-api-qps = 30"))
Expect(string(actualUserData)).To(ContainSubstring("memory.available = 300Mi"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we validate that we this value is assigned to the eviction soft section? As it stands, this check would pass if we passed the same key to eviction hard

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the E2E integration test as requested, please review at your convenience, thx!

})
// Windows tests are can flake due to the instance types that are used in testing.
// The VPC Resource controller will need to support the instance types that are used.
Expand Down
2 changes: 2 additions & 0 deletions test/suites/ami/testdata/br_userdata_input.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
kube-api-qps = 30
[settings.kubernetes.node-taints]
"node.cilium.io/agent-not-ready" = ["true:NoExecute"]
[settings.kubernetes.eviction-soft]
"memory.available" = "300Mi"