-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 update support for bigtable clusters (such as resizing) #2521
Comments
You're right - you should be able to. Let me make sure the API supports that, and I'll see what I can do. |
Shoot. The SDK, https://github.com/GoogleCloudPlatform/google-cloud-go/tree/master/bigtable, doesn't support the update method in the API. We'd have to convert the whole resource to using the REST API directly. That'd be part of the Magic Modules conversion effort - it will happen someday - but it's not likely in the very short term. :/ |
Blocked on googleapis/google-api-go-client#300 The current API client we're using doesn't let us |
@rileykarson any update on this? |
Unfortunately not! I'm trying to get the client generated but the team that's supposed to perform the next step hasn't done it yet. I'll ping them again. |
Oh wait- it looks like it appeared sometime in the last few weeks. 🎉 https://github.com/googleapis/google-api-go-client/tree/master/bigtableadmin/v2 |
@ndmckinley — can you please also file a bug on https://github.com/googleapis/google-cloud-go/tree/master/bigtable with the details on what resource objects need to have a proper Update method? We'd rather integrations use the client library SDK rather than the auto-generated methods in the Thanks! |
Hey @mbrukman - the next step for us is to use Magic Modules to generate our Bigtable integrations; MM has a requirement to have the autogen REST client right now, so we need to use that. We aren't blocked on features in the |
Generating bigtable support with Magic Modules is now possible, and that's the next step forwarding for adding update support for clusters. The issue is, the Bigtable API (whether REST or gRPC) doesn't map especially well to how we expect GCP resource to be shaped. Namely, we're required to provide clusters at creation time of the resource embedded into the instance resource (https://cloud.google.com/bigtable/docs/reference/admin/rest/v2/projects.instances/create), but it's then best to treat them as distinct resources at a separate API endpoint (https://cloud.google.com/bigtable/docs/reference/admin/rest/v2/projects.instances.clusters). This is similar to both network/subnetwork and GKE cluster/nodepools; cases like network/subnetwork map much better to Terraform, where the child resource is entirely distinct, versus cases like GKE nodepools where there's an awkward split between the resources. I have a pretty good idea of how I'd like to support the cluster update usecase, but it's going to be an unusual resource representation in Magic Modules, so I'm going to create a draft PR and/or design doc and get some feedback on that before moving forward- whether that's with MM or with handwritten changes to the resource. |
Hi @rileykarson! Any updates? |
I just hit this one too. The cluster is trying to be recreated with every change. Any status update is welcome. |
Any updates ? Magic Module is synced now, no ? |
I didn't end up having cycles to accomplish this previously. While investigating, I found that it's impossible to use Magic Modules for this today because of how clusters work (MM can't deal well with an object that must appear at creation time that's then effectively managed separately as another resource). It should be possible to add update support by keeping the resource handwritten and changing from the handwritten GRPC client to the generated REST one, but there's a chance it will fall afoul of the issues encountered with GKE node pools in #780 (comment). |
@rileykarson If the gRPC-based Go client for Bigtable had an UpdateInstance method would that unblock this? |
@garye if the update method on instance supported updating the list of clusters, this would be trivial to add. Even better, if the functionality was included in |
The underlying API for updating an instance just lets you upgrade from DEV->PRODUCTION. Sounds like you need to be able to do that, as well as update the size of clusters? What what an ideal client library (non-REST) method or methods look like from your perspective? We can also look into the REST stuff but I just know less about it... |
From my perspective, the ideal client method would be an update method that accepts the same body as create and that modifies the current instance to reach that state (failing if it's impossible). In the gRPC client, that's InstanceWithClustersConfig |
Ok that's doable, and "current cluster" means whatever clusters are present in the config object? We also need to return the instance type from |
Sorry- s/cluster/instance there. Modified the original post. Yep, that would also help. Terraform maintains local state so it would be possible to update an instance's type if a user specified |
Ok this is really useful, thanks! A new Is this acceptable? |
Yep- if an update fails, Terraform will be able to refresh state based on which changes were applied. |
Also return the instance type from InstanceInfo. This is necessary for terraform integration, see hashicorp/terraform-provider-google#2521 Change-Id: I7e4d6afcdc38393beb2045bf8388b97ef4155479 Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/42850 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
I just changed the number of nodes and this is the diff that is produced:
This is dangerous and we're manually scaling the cluster and adding a lifecycle block with
prevent_destroy
. You should be able to resize solely via terraform.The text was updated successfully, but these errors were encountered: