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

Add spotVM for GKE Node Pools #5443

Merged
merged 4 commits into from
Nov 18, 2021
Merged

Conversation

sepich
Copy link
Contributor

@sepich sepich commented Nov 11, 2021

GKE Node Pools now support Spot VMs (not to be confused with Preemptible VMs):
https://cloud.google.com/kubernetes-engine/docs/concepts/spot-vms
This is not supported in web UI yet, but gcloud cli have it:
https://cloud.google.com/kubernetes-engine/docs/how-to/spot-vms#create_a_node_pool_with_enabled
API field spot: https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/NodeConfig
Moved from: hashicorp/terraform-provider-google-beta#3833
part of hashicorp/terraform-provider-google#10309

Sorry, can't run acceptance tests. This has been tested via compiling terraform-provider-google-beta and we are using this custom compiled provider now to manage our spot vm node pools in gke.

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

container: added `spot` field to `node_config` sub-resource (beta)

@google-cla google-cla bot added the cla: yes label Nov 11, 2021
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@melinath, please review this PR or find an appropriate assignee.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 3 files changed, 15 insertions(+))
Terraform Beta: Diff ( 3 files changed, 15 insertions(+))

@sepich
Copy link
Contributor Author

sepich commented Nov 12, 2021

Unfortunately I have no permissions to check why terraform-provider-google-lint / terraform-provider-google-test tests fails. But even on master branch they seems to be broken:

$ git checkout master
$ make terraform VERSION=ga OUTPUT_PATH="$GOPATH/src/github.com/hashicorp/terraform-provider-google"
$ cd "$GOPATH/src/github.com/hashicorp/terraform-provider-google"
# too many unrelated files are changed:
$ git status | wc -l
44
$ make lint
==> Checking source code against linters...
ERRO [linters context] typechecking error: /home/i/gopath:/google/gopath/src/github.com/hashicorp/terraform-provider-google/google/resource_compute_subnetwork.go:40:22: undeclared name: cidr
make: *** [GNUmakefile:27: lint] Error 7

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

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

It looks like the linting errors are related to missing fields on container.NodeConfig. Perhaps you need to update a dependency in go.mod?

I'm not able to reproduce the broken lint check you described on master.

Signed-off-by: Alex R <[email protected]>
@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 6 insertions(+))
Terraform Beta: Diff ( 3 files changed, 17 insertions(+))

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 4 insertions(+))
Terraform Beta: Diff ( 3 files changed, 15 insertions(+))

@melinath melinath self-requested a review November 16, 2021 21:27
@melinath
Copy link
Member

melinath commented Nov 16, 2021

I'm running just the impacted test to see if this is working as expected. This comment is just a link for my own reference, no need to take action.

https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloudBeta_ProviderGoogleCloudBetaMmUpstream/219562

UPDATE: that passed.

@melinath
Copy link
Member

/gcbrun

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 1 file changed, 4 insertions(+))
Terraform Beta: Diff ( 3 files changed, 15 insertions(+))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeInstanceFromMachineImage_basic|TestAccComputeInstanceFromMachineImage_overrideMetadataDotStartupScript|TestAccComputeInstanceFromMachineImage_diffProject|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccContainerNodePool_withInvalidUpgradeSettings|TestAccEventarcTrigger_BasicHandWritten|TestAccNetworkServicesEdgeCacheOrigin_networkServicesEdgeCacheOriginAdvancedExample|TestAccNetworkServicesEdgeCacheService_networkServicesEdgeCacheServiceAdvancedExample|TestAccSqlUser_postgresIAM You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=219570

@sepich
Copy link
Contributor Author

sepich commented Nov 18, 2021

Sorry, what should I do now?
The list of failed tests seems unrelated, as here is only testAccContainerNodePool_withWorkloadMetadataConfig modified.
Unfortunately I cannot login via link with github oauth to see the details, because it asks for permissions to my private repos.

Copy link
Member

@melinath melinath left a comment

Choose a reason for hiding this comment

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

LGTM,I agree the test failures seem unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants