From b4f52385356cd083e5dbfe8ce168d9c2e390f0b4 Mon Sep 17 00:00:00 2001 From: Yang Lu Date: Mon, 2 Dec 2019 18:36:12 -0800 Subject: [PATCH 1/2] Add instructions about how to use kubetest to bring up e2e test cluster --- .../gce/windows/README-GCE-Windows-kube-up.md | 42 ++++++++++++++++++- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/cluster/gce/windows/README-GCE-Windows-kube-up.md b/cluster/gce/windows/README-GCE-Windows-kube-up.md index 83e3bfdaf6c..574c58d8945 100644 --- a/cluster/gce/windows/README-GCE-Windows-kube-up.md +++ b/cluster/gce/windows/README-GCE-Windows-kube-up.md @@ -78,9 +78,9 @@ export KUBERNETES_NODE_PLATFORM=windows export LOGGING_STACKDRIVER_RESOURCE_TYPES=new ``` -Now bring up a cluster using kube-up script: +Now bring up a cluster using one of the following two methods: -#### 2. Create a regular Kubernetes cluster +#### 2a. Create a regular Kubernetes cluster ``` # Invoke kube-up.sh with these environment variables: @@ -95,6 +95,44 @@ To teardown the cluster run: PROJECT=${CLOUDSDK_CORE_PROJECT} KUBERNETES_SKIP_CONFIRM=y ./cluster/kube-down.sh ``` +#### 2b. Create a Kubernetes end-to-end (E2E) test cluster + +Install or update `kubetest` as follows: +``` +go get -u k8s.io/test-infra/kubetest +``` +* If you see the error below, it's due to `github.com/Azure/go-autorest` dependencies are incompatible between different versions of go modules: + + ``` + build k8s.io/test-infra/kubetest: cannot load github.com/Azure/go-autorest/autorest: ambiguous import: found github.com/Azure/go-autorest/autorest in multiple modules: + github.com/Azure/go-autorest v11.1.2+incompatible (/usr/local/google/home/yluu/go/pkg/mod/github.com/!azure/go-autorest@v11.1.2+incompatible/autorest) + github.com/Azure/go-autorest/autorest v0.9.0 (/usr/local/google/home/yluu/go/pkg/mod/github.com/!azure/go-autorest/autorest@v0.9.0) + ``` + + Add `github.com/Azure/go-autorest v12.2.0+incompatible` into require block of `go.mod` and try again. + +If you have built your own release binaries following step 1, run the following +command: +``` +PROJECT=${CLOUDSDK_CORE_PROJECT} $GOPATH/bin/kubetest --up +``` + +Otherwise, you can specify what branch from which to get the release artifacts: +``` +# Get the latest build from the stable1 branch +PROJECT=${CLOUDSDK_CORE_PROJECT} $GOPATH/bin/kubetest --up --extract=ci/k8s-stable1 +# Or Get the latest build from master +PROJECT=${CLOUDSDK_CORE_PROJECT} $GOPATH/bin/kubetest --up --extract=ci-cross/latest +``` + +This command, by default, tears down any existing E2E cluster and creates a new +one. To teardown the cluster run the same command with `--down` instead of +`--up`. + +No matter what type of cluster you chose to create, the result should be a +Kubernetes cluster with one Linux master node, `NUM_NODES` Linux worker nodes +and `NUM_WINDOWS_NODES` Windows worker nodes. + ## Validating the cluster Invoke this script to run a smoke test that verifies that the cluster has been From b88788b0854e83b3ed122f96ad03e4646e56103f Mon Sep 17 00:00:00 2001 From: Yang Lu Date: Thu, 19 Dec 2019 20:03:49 -0800 Subject: [PATCH 2/2] update to use e2e-up.sh instead of kubetest --- .../gce/windows/README-GCE-Windows-kube-up.md | 35 ++++--------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/cluster/gce/windows/README-GCE-Windows-kube-up.md b/cluster/gce/windows/README-GCE-Windows-kube-up.md index 574c58d8945..d31e43831ca 100644 --- a/cluster/gce/windows/README-GCE-Windows-kube-up.md +++ b/cluster/gce/windows/README-GCE-Windows-kube-up.md @@ -56,9 +56,8 @@ make quick-release ### 2. Create a Kubernetes cluster -You can create a regular Kubernetes cluster or an end-to-end test cluster. -End-to-end test clusters support running the Kubernetes e2e tests and enable -some debugging features such as SSH access on the Windows nodes. +You can create a regular Kubernetes cluster or an end-to-end test cluster.
+Only end-to-end test clusters support running the Kubernetes e2e tests (as both [e2e cluster creation](https://github.com/kubernetes/kubernetes/blob/b632eaddbaad9dc1430d214d506b72750bbb9f69/hack/e2e-internal/e2e-up.sh#L24) and [e2e test scripts](https://github.com/kubernetes/kubernetes/blob/b632eaddbaad9dc1430d214d506b72750bbb9f69/hack/ginkgo-e2e.sh#L42) are setup based on `cluster/gce/config-test.sh`), also enables some debugging features such as SSH access on the Windows nodes. Please make sure you set the environment variables properly following the instructions in the previous section. @@ -96,38 +95,16 @@ PROJECT=${CLOUDSDK_CORE_PROJECT} KUBERNETES_SKIP_CONFIRM=y ./cluster/kube-down.s ``` #### 2b. Create a Kubernetes end-to-end (E2E) test cluster - -Install or update `kubetest` as follows: -``` -go get -u k8s.io/test-infra/kubetest -``` -* If you see the error below, it's due to `github.com/Azure/go-autorest` dependencies are incompatible between different versions of go modules: - - ``` - build k8s.io/test-infra/kubetest: cannot load github.com/Azure/go-autorest/autorest: ambiguous import: found github.com/Azure/go-autorest/autorest in multiple modules: - github.com/Azure/go-autorest v11.1.2+incompatible (/usr/local/google/home/yluu/go/pkg/mod/github.com/!azure/go-autorest@v11.1.2+incompatible/autorest) - github.com/Azure/go-autorest/autorest v0.9.0 (/usr/local/google/home/yluu/go/pkg/mod/github.com/!azure/go-autorest/autorest@v0.9.0) - ``` - - Add `github.com/Azure/go-autorest v12.2.0+incompatible` into require block of `go.mod` and try again. - If you have built your own release binaries following step 1, run the following command: ``` -PROJECT=${CLOUDSDK_CORE_PROJECT} $GOPATH/bin/kubetest --up +PROJECT=${CLOUDSDK_CORE_PROJECT} ./hack/e2e-internal/e2e-up.sh ``` -Otherwise, you can specify what branch from which to get the release artifacts: +If any e2e cluster exists already, this command will prompt you whether tears down and creates a new one. To teardown existing e2e cluster only, run the command: +``` +PROJECT=${CLOUDSDK_CORE_PROJECT} ./hack/e2e-internal/e2e-down.sh ``` -# Get the latest build from the stable1 branch -PROJECT=${CLOUDSDK_CORE_PROJECT} $GOPATH/bin/kubetest --up --extract=ci/k8s-stable1 -# Or Get the latest build from master -PROJECT=${CLOUDSDK_CORE_PROJECT} $GOPATH/bin/kubetest --up --extract=ci-cross/latest -``` - -This command, by default, tears down any existing E2E cluster and creates a new -one. To teardown the cluster run the same command with `--down` instead of -`--up`. No matter what type of cluster you chose to create, the result should be a Kubernetes cluster with one Linux master node, `NUM_NODES` Linux worker nodes