mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
stop using deprecated klog flags
Some scripts and tools still relied on the deprecated flags, the ones which are about to be removed. This is intentionally not a complete removal of all those flags in the entire repo. This would lead to much more code churn also in places where commands still accept the flags because they use klog directly.
This commit is contained in:
parent
6e3d62ca1c
commit
41619ace15
@ -66,7 +66,8 @@ cd "${GOPATH}/src/k8s.io/kubernetes"
|
|||||||
./hack/install-etcd.sh
|
./hack/install-etcd.sh
|
||||||
|
|
||||||
# Run the benchmark tests and pretty-print the results into a separate file.
|
# Run the benchmark tests and pretty-print the results into a separate file.
|
||||||
make test-integration WHAT="$*" KUBE_TEST_ARGS="-run='XXX' -bench=${TEST_PREFIX:-.} -benchtime=${BENCHTIME:-1s} -benchmem -alsologtostderr=false -logtostderr=false -data-items-dir=${ARTIFACTS}" \
|
# Log output of the tests go to stderr.
|
||||||
|
make test-integration WHAT="$*" KUBE_TEST_ARGS="-run='XXX' -bench=${TEST_PREFIX:-.} -benchtime=${BENCHTIME:-1s} -benchmem -data-items-dir=${ARTIFACTS}" \
|
||||||
| (go run test/integration/benchmark/extractlog/main.go) \
|
| (go run test/integration/benchmark/extractlog/main.go) \
|
||||||
| tee \
|
| tee \
|
||||||
>(prettybench -no-passthrough > "${ARTIFACTS}/BenchmarkResults.txt") \
|
>(prettybench -no-passthrough > "${ARTIFACTS}/BenchmarkResults.txt") \
|
||||||
|
@ -162,7 +162,7 @@ if [ "${remote}" = true ] && [ "${remote_mode}" = gce ] ; then
|
|||||||
echo "Kubelet Config File: ${kubelet_config_file}"
|
echo "Kubelet Config File: ${kubelet_config_file}"
|
||||||
|
|
||||||
# Invoke the runner
|
# Invoke the runner
|
||||||
go run test/e2e_node/runner/remote/run_remote.go --logtostderr --vmodule=*=4 --ssh-env="gce" \
|
go run test/e2e_node/runner/remote/run_remote.go --vmodule=*=4 --ssh-env="gce" \
|
||||||
--zone="${zone}" --project="${project}" --gubernator="${gubernator}" \
|
--zone="${zone}" --project="${project}" --gubernator="${gubernator}" \
|
||||||
--hosts="${hosts}" --images="${images}" --cleanup="${cleanup}" \
|
--hosts="${hosts}" --images="${images}" --cleanup="${cleanup}" \
|
||||||
--results-dir="${artifacts}" --ginkgo-flags="${ginkgoflags}" --runtime-config="${runtime_config}" \
|
--results-dir="${artifacts}" --ginkgo-flags="${ginkgoflags}" --runtime-config="${runtime_config}" \
|
||||||
@ -189,7 +189,7 @@ elif [ "${remote}" = true ] && [ "${remote_mode}" = ssh ] ; then
|
|||||||
test_args='--kubelet-flags="--cluster-domain='${KUBE_DNS_DOMAIN:-cluster.local}'" '${test_args}
|
test_args='--kubelet-flags="--cluster-domain='${KUBE_DNS_DOMAIN:-cluster.local}'" '${test_args}
|
||||||
|
|
||||||
# Invoke the runner
|
# Invoke the runner
|
||||||
go run test/e2e_node/runner/remote/run_remote.go --mode="ssh" --logtostderr --vmodule=*=4 \
|
go run test/e2e_node/runner/remote/run_remote.go --mode="ssh" --vmodule=*=4 \
|
||||||
--hosts="${hosts}" --results-dir="${artifacts}" --ginkgo-flags="${ginkgoflags}" \
|
--hosts="${hosts}" --results-dir="${artifacts}" --ginkgo-flags="${ginkgoflags}" \
|
||||||
--test_args="${test_args}" --system-spec-name="${system_spec_name}" \
|
--test_args="${test_args}" --system-spec-name="${system_spec_name}" \
|
||||||
--runtime-config="${runtime_config}" \
|
--runtime-config="${runtime_config}" \
|
||||||
@ -222,7 +222,7 @@ else
|
|||||||
go run test/e2e_node/runner/local/run_local.go \
|
go run test/e2e_node/runner/local/run_local.go \
|
||||||
--system-spec-name="${system_spec_name}" --extra-envs="${extra_envs}" \
|
--system-spec-name="${system_spec_name}" --extra-envs="${extra_envs}" \
|
||||||
--ginkgo-flags="${ginkgoflags}" \
|
--ginkgo-flags="${ginkgoflags}" \
|
||||||
--test-flags="--alsologtostderr --v 4 --report-dir=${artifacts} --node-name $(hostname) ${test_args}" \
|
--test-flags="--v 4 --report-dir=${artifacts} --node-name $(hostname) ${test_args}" \
|
||||||
--runtime-config="${runtime_config}" \
|
--runtime-config="${runtime_config}" \
|
||||||
--kubelet-config-file="${kubelet_config_file}" \
|
--kubelet-config-file="${kubelet_config_file}" \
|
||||||
--build-dependencies=true 2>&1 | tee -i "${artifacts}/build-log.txt"
|
--build-dependencies=true 2>&1 | tee -i "${artifacts}/build-log.txt"
|
||||||
|
@ -78,7 +78,7 @@ runTests() {
|
|||||||
make -C "${KUBE_ROOT}" test \
|
make -C "${KUBE_ROOT}" test \
|
||||||
WHAT="${WHAT:-$(kube::test::find_integration_test_dirs | paste -sd' ' -)}" \
|
WHAT="${WHAT:-$(kube::test::find_integration_test_dirs | paste -sd' ' -)}" \
|
||||||
GOFLAGS="${GOFLAGS:-}" \
|
GOFLAGS="${GOFLAGS:-}" \
|
||||||
KUBE_TEST_ARGS="--alsologtostderr=true ${SHORT:--short=true} --vmodule=${KUBE_TEST_VMODULE} ${KUBE_TEST_ARGS:-}" \
|
KUBE_TEST_ARGS="${SHORT:--short=true} --vmodule=${KUBE_TEST_VMODULE} ${KUBE_TEST_ARGS:-}" \
|
||||||
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
|
KUBE_TIMEOUT="${KUBE_TIMEOUT}" \
|
||||||
KUBE_RACE=""
|
KUBE_RACE=""
|
||||||
|
|
||||||
|
@ -84,7 +84,6 @@ kube::log::status "Starting kube-apiserver"
|
|||||||
--service-account-lookup="${SERVICE_ACCOUNT_LOOKUP}" \
|
--service-account-lookup="${SERVICE_ACCOUNT_LOOKUP}" \
|
||||||
--service-account-issuer="https://kubernetes.default.svc" \
|
--service-account-issuer="https://kubernetes.default.svc" \
|
||||||
--service-account-signing-key-file="${SERVICE_ACCOUNT_KEY}" \
|
--service-account-signing-key-file="${SERVICE_ACCOUNT_KEY}" \
|
||||||
--logtostderr \
|
|
||||||
--v=2 \
|
--v=2 \
|
||||||
--service-cluster-ip-range="10.0.0.0/24" >"${API_LOGFILE}" 2>&1 &
|
--service-cluster-ip-range="10.0.0.0/24" >"${API_LOGFILE}" 2>&1 &
|
||||||
APISERVER_PID=$!
|
APISERVER_PID=$!
|
||||||
|
@ -201,7 +201,6 @@ start_kubelet --kubeconfig "${KUBELET_KUBECONFIG}" \
|
|||||||
--system-cgroups=/system \
|
--system-cgroups=/system \
|
||||||
--cgroup-root=/ \
|
--cgroup-root=/ \
|
||||||
--v=$log_level \
|
--v=$log_level \
|
||||||
--logtostderr
|
|
||||||
|
|
||||||
wait_kubelet
|
wait_kubelet
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ TIMEOUT=${TIMEOUT:-"45m"}
|
|||||||
mkdir -p "${ARTIFACTS}"
|
mkdir -p "${ARTIFACTS}"
|
||||||
|
|
||||||
go run test/e2e_node/runner/remote/run_remote.go --test-suite=conformance \
|
go run test/e2e_node/runner/remote/run_remote.go --test-suite=conformance \
|
||||||
--logtostderr --vmodule=*=4 --ssh-env="gce" --ssh-user="$GCE_USER" \
|
--vmodule=*=4 --ssh-env="gce" --ssh-user="$GCE_USER" \
|
||||||
--zone="$GCE_ZONE" --project="$GCE_PROJECT" --hosts="$GCE_HOSTS" \
|
--zone="$GCE_ZONE" --project="$GCE_PROJECT" --hosts="$GCE_HOSTS" \
|
||||||
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \
|
--images="$GCE_IMAGES" --image-project="$GCE_IMAGE_PROJECT" \
|
||||||
--image-config-file="$GCE_IMAGE_CONFIG_PATH" --cleanup="$CLEANUP" \
|
--image-config-file="$GCE_IMAGE_CONFIG_PATH" --cleanup="$CLEANUP" \
|
||||||
|
@ -181,7 +181,7 @@ func launchKubelet(host, workspace, results, testArgs, bearerToken string) error
|
|||||||
return fmt.Errorf("failed to create kubelet pod manifest path %q: error - %v output - %q",
|
return fmt.Errorf("failed to create kubelet pod manifest path %q: error - %v output - %q",
|
||||||
podManifestPath, err, output)
|
podManifestPath, err, output)
|
||||||
}
|
}
|
||||||
startKubeletCmd := fmt.Sprintf("./%s --run-kubelet-mode --logtostderr --node-name=%s"+
|
startKubeletCmd := fmt.Sprintf("./%s --run-kubelet-mode --node-name=%s"+
|
||||||
" --bearer-token=%s"+
|
" --bearer-token=%s"+
|
||||||
" --report-dir=%s %s --kubelet-flags=--pod-manifest-path=%s > %s 2>&1",
|
" --report-dir=%s %s --kubelet-flags=--pod-manifest-path=%s > %s 2>&1",
|
||||||
conformanceTestBinary, host, bearerToken, results, testArgs, podManifestPath, filepath.Join(results, kubeletLauncherLog))
|
conformanceTestBinary, host, bearerToken, results, testArgs, podManifestPath, filepath.Join(results, kubeletLauncherLog))
|
||||||
|
@ -200,7 +200,7 @@ func (n *NodeE2ERemote) RunTest(host, workspace, results, imageDesc, junitFilePr
|
|||||||
klog.V(2).Infof("Starting tests on %q", host)
|
klog.V(2).Infof("Starting tests on %q", host)
|
||||||
cmd := getSSHCommand(" && ",
|
cmd := getSSHCommand(" && ",
|
||||||
fmt.Sprintf("cd %s", workspace),
|
fmt.Sprintf("cd %s", workspace),
|
||||||
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --system-spec-name=%s --system-spec-file=%s --extra-envs=%s --runtime-config=%s --logtostderr --v 4 --node-name=%s --report-dir=%s --report-prefix=%s --image-description=\"%s\" %s",
|
fmt.Sprintf("timeout -k 30s %fs ./ginkgo %s ./e2e_node.test -- --system-spec-name=%s --system-spec-file=%s --extra-envs=%s --runtime-config=%s --v 4 --node-name=%s --report-dir=%s --report-prefix=%s --image-description=\"%s\" %s",
|
||||||
timeout.Seconds(), ginkgoArgs, systemSpecName, systemSpecFile, extraEnvs, runtimeConfig, host, results, junitFilePrefix, imageDesc, testArgs),
|
timeout.Seconds(), ginkgoArgs, systemSpecName, systemSpecFile, extraEnvs, runtimeConfig, host, results, junitFilePrefix, imageDesc, testArgs),
|
||||||
)
|
)
|
||||||
return SSH(host, "sh", "-c", cmd)
|
return SSH(host, "sh", "-c", cmd)
|
||||||
|
@ -15,9 +15,9 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// To run the node e2e tests remotely against one or more hosts on gce:
|
// To run the node e2e tests remotely against one or more hosts on gce:
|
||||||
// $ go run run_remote.go --logtostderr --v 2 --ssh-env gce --hosts <comma separated hosts>
|
// $ go run run_remote.go --v 2 --ssh-env gce --hosts <comma separated hosts>
|
||||||
// To run the node e2e tests remotely against one or more images on gce and provision them:
|
// To run the node e2e tests remotely against one or more images on gce and provision them:
|
||||||
// $ go run run_remote.go --logtostderr --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
|
// $ go run run_remote.go --v 2 --project <project> --zone <zone> --ssh-env gce --images <comma separated images>
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -252,7 +252,7 @@ func (e *E2EServices) startKubelet(featureGates map[string]bool) (*server, error
|
|||||||
cmdArgs = append(cmdArgs,
|
cmdArgs = append(cmdArgs,
|
||||||
"--kubeconfig", kubeconfigPath,
|
"--kubeconfig", kubeconfigPath,
|
||||||
"--root-dir", KubeletRootDirectory,
|
"--root-dir", KubeletRootDirectory,
|
||||||
"--v", LogVerbosityLevel, "--logtostderr",
|
"--v", LogVerbosityLevel,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Apply test framework feature gates by default. This could also be overridden
|
// Apply test framework feature gates by default. This could also be overridden
|
||||||
|
@ -32,7 +32,7 @@ How To Run
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# In Kubernetes root path
|
# In Kubernetes root path
|
||||||
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling"
|
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling"
|
||||||
```
|
```
|
||||||
|
|
||||||
The benchmark suite runs all the tests specified under config/performance-config.yaml.
|
The benchmark suite runs all the tests specified under config/performance-config.yaml.
|
||||||
@ -47,14 +47,14 @@ Otherwise, the golang benchmark framework will try to run a test more than once
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
# In Kubernetes root path
|
# In Kubernetes root path
|
||||||
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling/SchedulingBasic/5000Nodes/5000InitPods/1000PodsToSchedule"
|
make test-integration WHAT=./test/integration/scheduler_perf ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling/SchedulingBasic/5000Nodes/5000InitPods/1000PodsToSchedule"
|
||||||
```
|
```
|
||||||
|
|
||||||
To produce a cpu profile:
|
To produce a cpu profile:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# In Kubernetes root path
|
# In Kubernetes root path
|
||||||
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TIMEOUT="-timeout=3600s" ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling -cpuprofile ~/cpu-profile.out"
|
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TIMEOUT="-timeout=3600s" ETCD_LOGLEVEL=warn KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling -cpuprofile ~/cpu-profile.out"
|
||||||
```
|
```
|
||||||
|
|
||||||
### How to configure benchmark tests
|
### How to configure benchmark tests
|
||||||
|
Loading…
Reference in New Issue
Block a user