Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Kubeadm e2e Tests #4684

Merged
merged 8 commits into from
Sep 22, 2017
Merged
23 changes: 21 additions & 2 deletions jobs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8180,6 +8180,7 @@
"--kubernetes-anywhere-kubelet-ci-version=latest",
"--kubernetes-anywhere-kubernetes-version=ci/latest",
"--provider=kubernetes-anywhere",
"--tag=latest",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this --tag flag is not going to work for prow jobs..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove

"--test_args=--ginkgo.focus=\\[Conformance\\]|\\[Feature:BootstrapTokens\\]|\\[Feature:NodeAuthorizer\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -8199,6 +8200,7 @@
"--kubernetes-anywhere-kubelet-ci-version=latest-1.6",
"--kubernetes-anywhere-kubernetes-version=latest-1.6",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -8218,6 +8220,7 @@
"--kubernetes-anywhere-kubelet-ci-version=latest-1.6",
"--kubernetes-anywhere-kubernetes-version=latest-1.6",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -8237,6 +8240,7 @@
"--kubernetes-anywhere-kubelet-ci-version=latest-1.7",
"--kubernetes-anywhere-kubernetes-version=latest-1.7",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -8256,6 +8260,7 @@
"--kubernetes-anywhere-kubelet-ci-version=latest-1.7",
"--kubernetes-anywhere-kubernetes-version=latest-1.7",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -8275,6 +8280,7 @@
"--kubernetes-anywhere-kubelet-ci-version=latest-1.8",
"--kubernetes-anywhere-kubernetes-version=latest-1.8",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\]|\\[Feature:BootstrapTokens\\]|\\[Feature:NodeAuthorizer\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -8294,6 +8300,7 @@
"--kubernetes-anywhere-kubelet-version=stable",
"--kubernetes-anywhere-kubernetes-version=stable",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\]|\\[Feature:BootstrapTokens\\]|\\[Feature:NodeAuthorizer\\] --minStartupPods=8",
"--timeout=300m"
],
Expand Down Expand Up @@ -10043,9 +10050,11 @@
"--extract=ci/latest-1.7",
"--gcp-zone=us-central1-f",
"--kubeadm=periodic",
"--kubernetes-anywhere-kubelet-ci-version=latest-1.6",
"--kubernetes-anywhere-kubernetes-version=latest-1.6",
"--kubernetes-anywhere-upgrade-method=kubeadm-upgrade",
"--kubernetes-anywhere-upgrade-method=init",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m",
"--upgrade_args=--ginkgo.focus=\\[Feature:MasterUpgrade\\]|\\[Conformance\\] --upgrade-target=ci/latest-1.7"
Expand All @@ -10064,9 +10073,11 @@
"--extract=ci/latest-1.8",
"--gcp-zone=us-central1-f",
"--kubeadm=periodic",
"--kubernetes-anywhere-kubelet-ci-version=latest-1.7",
"--kubernetes-anywhere-kubernetes-version=latest-1.7",
"--kubernetes-anywhere-upgrade-method=kubeadm-upgrade",
"--kubernetes-anywhere-upgrade-method=upgrade",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m",
"--upgrade_args=--ginkgo.focus=\\[Feature:MasterUpgrade\\]|\\[Conformance\\]|\\[Feature:BootstrapTokens\\]|\\[Feature:NodeAuthorizer\\] --upgrade-target=ci/latest-1.8"
Expand Down Expand Up @@ -10146,8 +10157,10 @@
"--extract=ci/latest-1.6",
"--gcp-zone=us-central1-f",
"--kubeadm=periodic",
"--kubernetes-anywhere-kubelet-ci-version=latest-1.6",
"--kubernetes-anywhere-kubernetes-version=latest-1.6",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -10164,8 +10177,10 @@
"--extract=ci/latest-1.7",
"--gcp-zone=us-central1-f",
"--kubeadm=periodic",
"--kubernetes-anywhere-kubelet-ci-version=latest-1.7",
"--kubernetes-anywhere-kubernetes-version=latest-1.7",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --minStartupPods=8",
"--timeout=300m"
],
Expand All @@ -10182,8 +10197,10 @@
"--extract=ci/latest-1.8",
"--gcp-zone=us-central1-f",
"--kubeadm=periodic",
"--kubernetes-anywhere-kubelet-ci-version=latest-1.8",
"--kubernetes-anywhere-kubernetes-version=latest-1.8",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\]|\\[Feature:BootstrapTokens\\]|\\[Feature:NodeAuthorizer\\] --minStartupPods=8",
"--timeout=300m"
],
Expand Down Expand Up @@ -10493,8 +10510,10 @@
"--gcp-zone=us-central1-f",
"--ginkgo-parallel=30",
"--kubeadm=pull",
"--kubernetes-anywhere-kubelet-ci-version=latest",
"--kubernetes-anywhere-kubernetes-version=ci/latest",
"--provider=kubernetes-anywhere",
"--tag=latest",
"--test_args=--ginkgo.focus=\\[Conformance\\] --ginkgo.skip=\\[Slow\\]|\\[Serial\\]|\\[Disruptive\\]|\\[Flaky\\] --minStartupPods=8",
"--timeout=55m",
"--use-shared-build=bazel"
Expand Down
6 changes: 3 additions & 3 deletions kubetest/anywhere.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ var (
"(kubernetes-anywhere only) Time limit between starting a cluster and making a successful call to the Kubernetes API.")
kubernetesAnywhereNumNodes = flag.Int("kubernetes-anywhere-num-nodes", 4,
"(kubernetes-anywhere only) Number of nodes to be deployed in the cluster.")
kubernetesAnywhereUpgradeMethod = flag.String("kubernetes-anywhere-upgrade-method", "kubeadm-upgrade",
"(kubernetes-anywhere only) Indicates whether to do the control plane upgrade with kubeadm method \"kubeadm-init\" or \"kubeadm-upgrade\"")
kubernetesAnywhereUpgradeMethod = flag.String("kubernetes-anywhere-upgrade-method", "upgrade",
"(kubernetes-anywhere only) Indicates whether to do the control plane upgrade with kubeadm method \"init\" or \"upgrade\"")
)

const kubernetesAnywhereConfigTemplate = `
Expand All @@ -74,7 +74,7 @@ const kubernetesAnywhereConfigTemplate = `
.phase2.kubelet_version="{{.KubeletVersion}}"
.phase2.kubeadm.version="{{.KubeadmVersion}}"
.phase2.kube_context_name="{{.KubeContext}}"
.phase2.upgrade_method="{{.UpgradeMethod}}"
.phase2.kubeadm.master_upgrade.method="{{.UpgradeMethod}}"

.phase3.run_addons=y
.phase3.weave_net={{if eq .Phase2Provider "kubeadm" -}} y {{- else -}} n {{- end}}
Expand Down
5 changes: 5 additions & 0 deletions kubetest/anywhere_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestNewKubernetesAnywhere(t *testing.T) {
name string
phase2 string
kubeadmVersion string
kubeadmUpgrade string
kubeletCIVersion string
kubeletVersion string
kubernetesVersion string
Expand All @@ -39,6 +40,7 @@ func TestNewKubernetesAnywhere(t *testing.T) {
expectConfigLines: []string{
".phase2.provider=\"kubeadm\"",
".phase2.kubeadm.version=\"\"",
".phase2.kubeadm.master_upgrade.method=\"\"",
".phase2.kubernetes_version=\"\"",
".phase2.kubelet_version=\"\"",
".phase3.weave_net=y",
Expand All @@ -57,11 +59,13 @@ func TestNewKubernetesAnywhere(t *testing.T) {
name: "kubeadm with specific versions",
phase2: "kubeadm",
kubeadmVersion: "unstable",
kubeadmUpgrade: "init",
kubeletVersion: "foo",
kubernetesVersion: "latest-1.6",
expectConfigLines: []string{
".phase2.provider=\"kubeadm\"",
".phase2.kubeadm.version=\"unstable\"",
".phase2.kubeadm.master_upgrade.method=\"init\"",
".phase2.kubernetes_version=\"latest-1.6\"",
".phase2.kubelet_version=\"foo\"",
".phase3.weave_net=y",
Expand Down Expand Up @@ -115,6 +119,7 @@ func TestNewKubernetesAnywhere(t *testing.T) {
*kubernetesAnywhereKubernetesVersion = tc.kubernetesVersion
*kubernetesAnywhereKubeletVersion = tc.kubeletVersion
*kubernetesAnywhereKubeletCIVersion = tc.kubeletCIVersion
*kubernetesAnywhereUpgradeMethod = tc.kubeadmUpgrade

_, err = newKubernetesAnywhere("fake-project", "fake-zone")
if err != nil {
Expand Down