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

disable gke deployment for clusters with installation by default if GKE deployment is not requested #679

Merged
merged 1 commit into from
Dec 8, 2020

Conversation

verult
Copy link
Contributor

@verult verult commented Dec 1, 2020

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation

/kind failing-test

/kind feature
/kind flake

What this PR does / why we need it: 1.18 driver tests are failing when an overlay is used in a GKE deployment because the GKE deployment is enabled by default. This PR explicitly disables it.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

/assign @saikat-royc

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 1, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: verult

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 1, 2020
@@ -379,3 +394,10 @@ func getKubeClient() (kubernetes.Interface, error) {
}
return kubeClient, nil
}

func isGKEDeploymentInstalledByDefault(clusterVersion string) bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to query the cluster to see if it's already enabled, instead of encoding versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could parse the output of gcloud beta container clusters describe. It might be good to test these version bounds for defaulting tho, and it's also a teeny bit less work

Copy link
Member

@saikat-royc saikat-royc Dec 1, 2020

Choose a reason for hiding this comment

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

This function should check if we detect a pdcsi-node daemonset in kube-system namespace.(as this indirectly indicates that the component is enabled). Thoughts?

Copy link
Contributor Author

@verult verult Dec 1, 2020

Choose a reason for hiding this comment

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

I think it's still good to use version bounds so that defaulting is only done in the versions we expect, but not a huge benefit since other test suites already cover defaulting testing. No strong preference either way

Calling kubectl to get DaemonSet info also requires parsing, in which case I would prefer getting the addonsConfig from clusters describe which is the definitive state of whether GKE deployment should be running.

WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

Agree that checking addonsConfig is the right way to do it.
The only issue with checking k8s version, is that we would need to revisit and update the logic again, if there is a on-by-default is enabled for 1.17 clusters for e.g and also then it may get complicated with all the patch version comparision.
For immediate relief to the test failures I am ok with the k8s version check, but eventually we should check addonsConfig.

WDYT @msau42 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Long term I agree checking addons config is the right way. This is fine for now

Copy link
Contributor Author

@verult verult Dec 4, 2020

Choose a reason for hiding this comment

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

Ah right yeah all the backports. Will add a TODO here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually once the GKE go client refactor happens, we could just always explicitly enable/disable on cluster create. Defaulting logic is already tested elsewhere so not having coverage here is OK.

@verult
Copy link
Contributor Author

verult commented Dec 1, 2020

Local Prow run passing

@verult
Copy link
Contributor Author

verult commented Dec 1, 2020

@msau42 @saikat-royc Created #680 to track refactor to use GKE go client. Updating regional clusters takes way too long through gcloud.

@@ -379,3 +394,10 @@ func getKubeClient() (kubernetes.Interface, error) {
}
return kubeClient, nil
}

func isGKEDeploymentInstalledByDefault(clusterVersion string) bool {
cv := apimachineryversion.MustParseSemantic(clusterVersion)
Copy link
Member

Choose a reason for hiding this comment

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

Since this is GKE version, should we use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the one used here I believe

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah gotcha, updated

@verult verult force-pushed the disable-gke-deployment branch from 423ae53 to 090ad76 Compare December 5, 2020 02:01
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 5, 2020
@saikat-royc
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2020
@saikat-royc
Copy link
Member

tagging @mattcary to be in the loop

@k8s-ci-robot k8s-ci-robot merged commit 4c46bb8 into kubernetes-sigs:master Dec 8, 2020
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. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants