Skip to content

add ability to use gcloud to boot a gke cluster for e2e integration #288

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

Merged

Conversation

hantaowang
Copy link

@hantaowang hantaowang commented Jun 6, 2019

Adds the following flags to k8s-integration-test:

  • deployment-strategy: If a cluster needs to be booted up, choose if it is done on GCE through the kube-ip.sh script or GKE through the gcloud utility. The GKE option is incompatible with the migration test and must use a cluster version supported by GKE. Feature gates cannot be turned on when GKE is used. The default value is "gce", and GKE can be turned on by setting it to "gke".
  • gke-cluster-version: If GKE is used, this flag can be set to an available cluster version, which can be checked with gcloud container get-server-config. Also accepted values are "latest" and "stable". The deault value is "latest".

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 6, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @hantaowang. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 6, 2019
@davidz627
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 6, 2019
@@ -59,6 +61,7 @@ var (
const (
pdImagePlaceholder = "gcr.io/gke-release/gcp-compute-persistent-disk-csi-driver"
k8sBuildBinDir = "_output/dockerized/bin/linux/amd64"
gkeTestClusterName = "gcp-pd-csi-driver-test-cluster"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we append some random suffix to it? That will let us run multiple test instances in parallel. Or if some previous test cluster failed to cleanup properly, then subsequent test runs would not get blocked.

Copy link
Author

Choose a reason for hiding this comment

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

Unless I'm mistaken, the current kube-up script does not do this either. Are separate tests run through prow supposed to be run on separate projects, thus avoiding any concurrent and subsequent conflicts.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, technically with boskos project lending, there shouldn't be concurrent runs in the same project. However, I'm thinking more about the scenario where a previous run failed to properly clean up the cluster (for whatever reason).

The kube-up script first tries to delete any existing cluster before trying to create a new one to get around this issue. We may want to consider doing something similar for gke.

Copy link
Contributor

@davidz627 davidz627 left a comment

Choose a reason for hiding this comment

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

2 small comments.

Once those are resolved LGTM feel free to squash commits.

}

if *teardownCluster {
defer func() {
err := clusterDown(k8sDir)
var err error
if *deploymentStrat == "gke" {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this can also be better as a switch statement and should contain a default with an error.

It's possible to have teardownCluster set without bringUpCluster set. So it's not safe to assume *deploymentStrat != "gke" --> deploymentStrat == gce in this case.

@hantaowang
Copy link
Author

@msau42 @davidz627 the latest commit should address your remaining comments. if there is nothing else, I will squash tomorrow morning for the final approval.

@hantaowang hantaowang force-pushed the gke-integration-tests branch from 631e197 to 531f5c7 Compare June 7, 2019 16:57
@davidz627
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 7, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidz627, hantaowang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit 64b78c7 into kubernetes-sigs:master Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants