mirror of https://github.com/k3s-io/k3s
Merge pull request #45602 from dashpole/enable_memcg_for_all_tests
Automatic merge from submit-queue (batch tested with PRs 45569, 45602, 45604, 45478, 45550) Enable kernel memcg notification for node and cluster GCI/COS testing. Sets --experimental-kernel-memcg-notification=true when running on the GCI/COS image. It sets this for master and nodes for cluster e2e tests, and for the node in node e2e tests. Issue #42676 cc @dchen1107 @Random-Liupull/6/head
commit
a507d30833
|
@ -149,6 +149,12 @@ TEST_CLUSTER_RESYNC_PERIOD="${TEST_CLUSTER_RESYNC_PERIOD:---min-resync-period=3m
|
||||||
TEST_CLUSTER_API_CONTENT_TYPE="${TEST_CLUSTER_API_CONTENT_TYPE:-}"
|
TEST_CLUSTER_API_CONTENT_TYPE="${TEST_CLUSTER_API_CONTENT_TYPE:-}"
|
||||||
|
|
||||||
KUBELET_TEST_ARGS="${KUBELET_TEST_ARGS:-} --max-pods=110 --serialize-image-pulls=false --outofdisk-transition-frequency=0 ${TEST_CLUSTER_API_CONTENT_TYPE}"
|
KUBELET_TEST_ARGS="${KUBELET_TEST_ARGS:-} --max-pods=110 --serialize-image-pulls=false --outofdisk-transition-frequency=0 ${TEST_CLUSTER_API_CONTENT_TYPE}"
|
||||||
|
if [[ "${NODE_OS_DISTRIBUTION}" == "gci" ]]; then
|
||||||
|
NODE_KUBELET_TEST_ARGS=" --experimental-kernel-memcg-notification=true"
|
||||||
|
fi
|
||||||
|
if [[ "${MASTER_OS_DISTRIBUTION}" == "gci" ]]; then
|
||||||
|
MASTER_KUBELET_TEST_ARGS=" --experimental-kernel-memcg-notification=true"
|
||||||
|
fi
|
||||||
APISERVER_TEST_ARGS="${APISERVER_TEST_ARGS:-} --runtime-config=extensions/v1beta1 ${TEST_CLUSTER_DELETE_COLLECTION_WORKERS} ${TEST_CLUSTER_MAX_REQUESTS_INFLIGHT}"
|
APISERVER_TEST_ARGS="${APISERVER_TEST_ARGS:-} --runtime-config=extensions/v1beta1 ${TEST_CLUSTER_DELETE_COLLECTION_WORKERS} ${TEST_CLUSTER_MAX_REQUESTS_INFLIGHT}"
|
||||||
CONTROLLER_MANAGER_TEST_ARGS="${CONTROLLER_MANAGER_TEST_ARGS:-} ${TEST_CLUSTER_RESYNC_PERIOD} ${TEST_CLUSTER_API_CONTENT_TYPE}"
|
CONTROLLER_MANAGER_TEST_ARGS="${CONTROLLER_MANAGER_TEST_ARGS:-} ${TEST_CLUSTER_RESYNC_PERIOD} ${TEST_CLUSTER_API_CONTENT_TYPE}"
|
||||||
SCHEDULER_TEST_ARGS="${SCHEDULER_TEST_ARGS:-} ${TEST_CLUSTER_API_CONTENT_TYPE}"
|
SCHEDULER_TEST_ARGS="${SCHEDULER_TEST_ARGS:-} ${TEST_CLUSTER_API_CONTENT_TYPE}"
|
||||||
|
|
|
@ -681,6 +681,7 @@ function start-kubelet {
|
||||||
flags+=" --port=${KUBELET_PORT}"
|
flags+=" --port=${KUBELET_PORT}"
|
||||||
fi
|
fi
|
||||||
if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
|
if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
|
||||||
|
flags+="${MASTER_KUBELET_TEST_ARGS:-}"
|
||||||
flags+=" --enable-debugging-handlers=false"
|
flags+=" --enable-debugging-handlers=false"
|
||||||
flags+=" --hairpin-mode=none"
|
flags+=" --hairpin-mode=none"
|
||||||
if [[ "${REGISTER_MASTER_KUBELET:-false}" == "true" ]]; then
|
if [[ "${REGISTER_MASTER_KUBELET:-false}" == "true" ]]; then
|
||||||
|
@ -691,6 +692,7 @@ function start-kubelet {
|
||||||
flags+=" --pod-cidr=${MASTER_IP_RANGE}"
|
flags+=" --pod-cidr=${MASTER_IP_RANGE}"
|
||||||
fi
|
fi
|
||||||
else # For nodes
|
else # For nodes
|
||||||
|
flags+="${NODE_KUBELET_TEST_ARGS:-}"
|
||||||
flags+=" --enable-debugging-handlers=true"
|
flags+=" --enable-debugging-handlers=true"
|
||||||
flags+=" --api-servers=https://${KUBERNETES_MASTER_NAME}"
|
flags+=" --api-servers=https://${KUBERNETES_MASTER_NAME}"
|
||||||
if [[ "${HAIRPIN_MODE:-}" == "promiscuous-bridge" ]] || \
|
if [[ "${HAIRPIN_MODE:-}" == "promiscuous-bridge" ]] || \
|
||||||
|
|
|
@ -13,7 +13,7 @@ CLEANUP=true
|
||||||
# gci-docker-version specifies docker version in GCI image.
|
# gci-docker-version specifies docker version in GCI image.
|
||||||
GCE_INSTANCE_METADATA="user-data<${GCI_CLOUD_INIT},gci-docker-version=${DOCKER_VERSION},gci-update-strategy=update_disabled"
|
GCE_INSTANCE_METADATA="user-data<${GCI_CLOUD_INIT},gci-docker-version=${DOCKER_VERSION},gci-update-strategy=update_disabled"
|
||||||
GINKGO_FLAGS='--focus="MemoryEviction" --skip=""'
|
GINKGO_FLAGS='--focus="MemoryEviction" --skip=""'
|
||||||
TEST_ARGS='--kubelet-flags=--experimental-kernel-memcg-notification=true --feature-gates=DynamicKubeletConfig=true'
|
TEST_ARGS='--kubelet-flags=--feature-gates=DynamicKubeletConfig=true'
|
||||||
KUBELET_ARGS='--cgroups-per-qos=true --cgroup-root=/'
|
KUBELET_ARGS='--cgroups-per-qos=true --cgroup-root=/'
|
||||||
PARALLELISM=1
|
PARALLELISM=1
|
||||||
TIMEOUT=1h
|
TIMEOUT=1h
|
||||||
|
|
|
@ -108,9 +108,9 @@ func tarAddCOSMounter(tar string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateCOSMounterPath updates kubelet flags to set gci mounter path. This will only take effect for
|
// updateCOSKubeletFlags updates kubelet flags to set gci mounter path, and enables memcg notifications. This will only take effect for
|
||||||
// GCI/COS image.
|
// GCI/COS image.
|
||||||
func updateCOSMounterPath(args, host, workspace string) (string, error) {
|
func updateCOSKubeletFlags(args, host, workspace string) (string, error) {
|
||||||
// Determine if tests will run on a GCI/COS node.
|
// Determine if tests will run on a GCI/COS node.
|
||||||
output, err := SSH(host, "cat", "/etc/os-release")
|
output, err := SSH(host, "cat", "/etc/os-release")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -145,7 +145,7 @@ func updateCOSMounterPath(args, host, workspace string) (string, error) {
|
||||||
return args, fmt.Errorf("unabled to chmod 544 GCI/COS mounter script. Err: %v, Output:\n%s", err, output)
|
return args, fmt.Errorf("unabled to chmod 544 GCI/COS mounter script. Err: %v, Output:\n%s", err, output)
|
||||||
}
|
}
|
||||||
// Insert args at beginning of test args, so any values from command line take precedence
|
// Insert args at beginning of test args, so any values from command line take precedence
|
||||||
args = fmt.Sprintf("--kubelet-flags=--experimental-mounter-path=%s ", mounterPath) + args
|
args = fmt.Sprintf("--kubelet-flags='--experimental-kernel-memcg-notification=true --experimental-mounter-path=%s'", mounterPath) + args
|
||||||
return args, nil
|
return args, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ func (n *NodeE2ERemote) RunTest(host, workspace, results, junitFilePrefix, testA
|
||||||
// Kill any running node processes
|
// Kill any running node processes
|
||||||
cleanupNodeProcesses(host)
|
cleanupNodeProcesses(host)
|
||||||
|
|
||||||
testArgs, err := updateCOSMounterPath(testArgs, host, workspace)
|
testArgs, err := updateCOSKubeletFlags(testArgs, host, workspace)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue