diff --git a/hack/make-rules/test-e2e-node.sh b/hack/make-rules/test-e2e-node.sh index 7ee66c14ef8..3778fef5382 100755 --- a/hack/make-rules/test-e2e-node.sh +++ b/hack/make-rules/test-e2e-node.sh @@ -49,7 +49,7 @@ extra_envs=${EXTRA_ENVS:-} runtime_config=${RUNTIME_CONFIG:-} ssh_user=${SSH_USER:-"${USER}"} ssh_key=${SSH_KEY:-} -kubelet_config_file=${KUBELET_CONFIG_FILE:-""} +kubelet_config_file=${KUBELET_CONFIG_FILE:-"test/e2e_node/jenkins/default-kubelet-config.yaml"} # Parse the flags to pass to ginkgo ginkgoflags="" diff --git a/test/e2e_node/jenkins/default-kubelet-config.yaml b/test/e2e_node/jenkins/default-kubelet-config.yaml new file mode 100644 index 00000000000..36acf31218b --- /dev/null +++ b/test/e2e_node/jenkins/default-kubelet-config.yaml @@ -0,0 +1,27 @@ +apiVersion: kubelet.config.k8s.io/v1beta1 +kind: KubeletConfiguration +cgroupDriver: cgroupfs +cgroupRoot: / + +# Assign a fixed CIDR to the node because we do not run a node controller +# This MUST be in sync with IPs in: +# - cluster/gce/config-test.sh and +# - test/e2e_node/conformance/run_test.sh +podCIDR: "10.100.0.0/24" + +# Aggregate volumes frequently to reduce test wait times +volumeStatsAggPeriod: 10s +# Check files frequently to reduce test wait times +fileCheckFrequency: 10s + +evictionPressureTransitionPeriod: 30s +evictionHard: + memory.available: 250Mi + nodefs.available: 10% + nodefs.inodesFree: 5% +evictionMinimumReclaim: + nodefs.available: 5% + nodefs.inodesFree: 5% + +serializeImagePulls: false + diff --git a/test/e2e_node/services/kubelet.go b/test/e2e_node/services/kubelet.go index 34d63089520..dff1da3ce99 100644 --- a/test/e2e_node/services/kubelet.go +++ b/test/e2e_node/services/kubelet.go @@ -24,9 +24,7 @@ import ( "os/exec" "path/filepath" "strings" - "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilfeature "k8s.io/apiserver/pkg/util/feature" cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" @@ -173,38 +171,9 @@ func (e *E2EServices) startKubelet() (*server, error) { // --read-only-port kc.ReadOnlyPort = ports.KubeletReadOnlyPort - // Setup general overrides for the kubelet. - // TODO(endocrimes): Move the following to a `default` configuration file - - kc.CgroupRoot = "/" - - kc.VolumeStatsAggPeriod = metav1.Duration{Duration: 10 * time.Second} // Aggregate volumes frequently so tests don't need to wait as long - - kc.SerializeImagePulls = false - + // Static Pods are in a per-test location, so we override them for tests. kc.StaticPodPath = podPath - kc.FileCheckFrequency = metav1.Duration{Duration: 10 * time.Second} // Check file frequently so tests won't wait too long - - // Assign a fixed CIDR to the node because there is no node controller. - // Note: this MUST be in sync with the IP in - // - cluster/gce/config-test.sh and - // - test/e2e_node/conformance/run_test.sh. - kc.PodCIDR = "10.100.0.0/24" - - kc.EvictionPressureTransitionPeriod = metav1.Duration{Duration: 30 * time.Second} - - kc.EvictionHard = map[string]string{ - "memory.available": "250Mi", - "nodefs.available": "10%", - "nodefs.inodesFree": "5%", - } - - kc.EvictionMinimumReclaim = map[string]string{ - "nodefs.available": "5%", - "nodefs.inodesFree": "5%", - } - var killCommand, restartCommand *exec.Cmd var isSystemd bool // Apply default kubelet flags.