e2e_node: kubelet config: move to file where possible

This commit is contained in:
Danielle Lancashire 2021-10-07 20:46:03 +02:00
parent 4097a3d472
commit 6e9e436026
3 changed files with 29 additions and 33 deletions

View File

@ -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=""

View File

@ -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

View File

@ -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.