mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 05:02:50 +00:00
Set custom threshold for memory eviction test
This commit is contained in:
@@ -77,6 +77,7 @@ go_test(
|
|||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/v1:go_default_library",
|
"//pkg/api/v1:go_default_library",
|
||||||
|
"//pkg/apis/componentconfig:go_default_library",
|
||||||
"//pkg/client/clientset_generated/clientset:go_default_library",
|
"//pkg/client/clientset_generated/clientset:go_default_library",
|
||||||
"//pkg/kubelet:go_default_library",
|
"//pkg/kubelet:go_default_library",
|
||||||
"//pkg/kubelet/api/v1alpha1/stats:go_default_library",
|
"//pkg/kubelet/api/v1alpha1/stats:go_default_library",
|
||||||
|
@@ -25,6 +25,7 @@ import (
|
|||||||
"k8s.io/apimachinery/pkg/api/resource"
|
"k8s.io/apimachinery/pkg/api/resource"
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/kubernetes/pkg/api/v1"
|
"k8s.io/kubernetes/pkg/api/v1"
|
||||||
|
"k8s.io/kubernetes/pkg/apis/componentconfig"
|
||||||
"k8s.io/kubernetes/test/e2e/framework"
|
"k8s.io/kubernetes/test/e2e/framework"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
@@ -35,16 +36,26 @@ import (
|
|||||||
// https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/kubelet-eviction.md
|
// https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/kubelet-eviction.md
|
||||||
|
|
||||||
var _ = framework.KubeDescribe("MemoryEviction [Slow] [Serial] [Disruptive]", func() {
|
var _ = framework.KubeDescribe("MemoryEviction [Slow] [Serial] [Disruptive]", func() {
|
||||||
|
const (
|
||||||
|
evictionHard = "memory.available<40%"
|
||||||
|
)
|
||||||
|
|
||||||
f := framework.NewDefaultFramework("eviction-test")
|
f := framework.NewDefaultFramework("eviction-test")
|
||||||
|
|
||||||
// This is a dummy context to wrap the outer AfterEach, which will run after the inner AfterEach.
|
// This is a dummy context to wrap the outer AfterEach, which will run after the inner AfterEach.
|
||||||
// We want to list all of the node and pod events, including any that occur while waiting for
|
// We want to list all of the node and pod events, including any that occur while waiting for
|
||||||
// memory pressure reduction, even if we time out while waiting.
|
// memory pressure reduction, even if we time out while waiting.
|
||||||
Context("", func() {
|
Context("", func() {
|
||||||
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
|
// Print events
|
||||||
logNodeEvents(f)
|
logNodeEvents(f)
|
||||||
logPodEvents(f)
|
logPodEvents(f)
|
||||||
})
|
})
|
||||||
|
Context("", func() {
|
||||||
|
tempSetCurrentKubeletConfig(f, func(c *componentconfig.KubeletConfiguration) {
|
||||||
|
c.EvictionHard = evictionHard
|
||||||
|
})
|
||||||
|
|
||||||
Context("when there is memory pressure", func() {
|
Context("when there is memory pressure", func() {
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
@@ -217,6 +228,7 @@ var _ = framework.KubeDescribe("MemoryEviction [Slow] [Serial] [Disruptive]", fu
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user