Terraform-provider-google: Support configuring GKE resource usage metering

Created on 12 Dec 2018  ·  11Comments  ·  Source: hashicorp/terraform-provider-google


Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

GKE supports resource usage metering right now. It'd be great if Terraform supported configuring this option as well. Otherwise, we have to manually enable or disable it. Manually configuring it means it's prone to human error and isn't declarative or versioned.

New or Affected Resource(s)

  • google_container_cluster

Potential Terraform Configuration

resource "google_container_cluster" "primary" {
  resource_usage_bigquery_dataset <name of BigQuery dataset>
}

Not specifying resource_usage_bigquery_dataset means it's disabled.

References

None

enhancement

Most helpful comment

It would be good to get this prioritized. This is a knob we want to turn on as we create gke clusters using terraform.

All 11 comments

Can do, as long as it's featured in the API... but I can't find any evidence that it is. Looks gcloud exclusive according to the docs here: https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-usage-metering. I'll keep looking.

Aha, yes:

You cannot currently enable usage metering using the Google Cloud Platform Console.

So it's gcloud-exclusive - if you want it in Terraform, for now you'll need to use provisioners or null resources which shell out to gcloud to set it up. Tagging as upstream for reconsideration later.

Good to know. Thanks for checking.

David Xia
davidxia.com

Well! It's not in the docs, but if you add "resourceUsageExportConfig": {"bigqueryDestination": {"datasetId": "some-dataset"}} at top level under the "cluster" block during the create call, then it does seem to work. :)

@ndmckinley Thanks. I'm having trouble getting that to work though. Could you give an example?

Ah, I didn't write that clearly! That's a note for the eventual implementation, it won't be doable right now in config.

It would be good to get this prioritized. This is a knob we want to turn on as we create gke clusters using terraform.

hey @ndmckinley / @rileykarson have a PR for this in https://github.com/GoogleCloudPlatform/magic-modules/pull/1742 - any chance you guys can take a look?

the workaround for us right now to have this enabled as part of our gke cluster module(s) is to use a local-exec provisioner to run the gcloud command to update the cluster once created but it is painfully slow (avg 18min to update) compare to when you create the cluster with this already enabled

Thanks @manuelfelipe! It looks like nobody got to it last week, but I'll prod someone to review it if it's left untouched for a couple more days.

Assigning to @hashibot to mark that @manuelfelipe is working on this.

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 👉 [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings