简体   繁体   English

如何通过 terraform 在 GCP Cloud 中禁用 GKE 服务中的日志记录和监控服务

[英]How to disable logging and monitoring service in GKE service in GCP Cloud via terraform

I have a terraform code to enable logging and monitoring service in GKE service of GCP console via terrraform, But the GCP console by default enables the logging and monitoring services.我有一个 terraform 代码可以通过 terrraform 在 GCP 控制台的 GKE 服务中启用日志记录和监控服务,但是 GCP 控制台默认启用日志记录和监控服务。 Now I am trying to disable the logging and monitoring service, I dont see any code or keyword to disable it, anyone can help me here?现在我正在尝试禁用日志记录和监控服务,我没有看到任何代码或关键字来禁用它,任何人都可以在这里帮助我吗?

 resource "google_container_cluster" "test" {
  logging_service = "logging.googleapis.com/kubernetes"
  monitoring_service = "monitoring.googleapis.com/kubernetes"
  }
###how to disable this? I tried with
 resource "google_container_cluster" "test" {
   logging_service = ""
   monitoring_service = ""
  }

But not working..但不工作..

According to this link, try leaving the monitoring_config block off completely and set monitoring_service to "none" and see if that resolves your issue:根据此链接,尝试完全关闭monitoring_config块并将monitoring_service设置为“无”,看看是否可以解决您的问题:

https://github.com/hashicorp/terraform-provider-google/issues/10308 https://github.com/hashicorp/terraform-provider-google/issues/10308

From Terraform documentation:来自Terraform文档:

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/container_cluster

monitoring_service - (Optional) The monitoring service that the cluster should write metrics to.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM