From 8418a7105e7e0e70737f30f5858e527de2da6131 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Wed, 9 Apr 2025 23:49:13 +0000 Subject: [PATCH 1/2] feat(GKE): add hpa_logs --- gke/standard/regional/hpa-logs/main.tf | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 gke/standard/regional/hpa-logs/main.tf diff --git a/gke/standard/regional/hpa-logs/main.tf b/gke/standard/regional/hpa-logs/main.tf new file mode 100644 index 000000000..49b26ef0f --- /dev/null +++ b/gke/standard/regional/hpa-logs/main.tf @@ -0,0 +1,34 @@ +/** +* Copyright 2025 Google LLC +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +# [START gke_standard_regional_hpa_logs] +resource "google_container_cluster" "default" { + name = "gke-standard-hpa-logs" + location = "us-central1" + initial_node_count = 1 + + monitoring_config { + enable_components = ["SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER"] + } + logging_config { + enable_components = ["SYSTEM_COMPONENTS", "KCP_HPA"] + } + + # Set `deletion_protection` to `true` will ensure that one cannot + # accidentally delete this instance by use of Terraform. + deletion_protection = false +} +# [END gke_standard_regional_hpa_logs] From 98505ab0e21085b554b0b2a804fa393b6ad29a94 Mon Sep 17 00:00:00 2001 From: Andrew Peabody Date: Thu, 10 Apr 2025 10:56:17 -0700 Subject: [PATCH 2/2] Update main.tf --- gke/standard/regional/hpa-logs/main.tf | 3 --- 1 file changed, 3 deletions(-) diff --git a/gke/standard/regional/hpa-logs/main.tf b/gke/standard/regional/hpa-logs/main.tf index 49b26ef0f..09b4f13e9 100644 --- a/gke/standard/regional/hpa-logs/main.tf +++ b/gke/standard/regional/hpa-logs/main.tf @@ -20,9 +20,6 @@ resource "google_container_cluster" "default" { location = "us-central1" initial_node_count = 1 - monitoring_config { - enable_components = ["SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER"] - } logging_config { enable_components = ["SYSTEM_COMPONENTS", "KCP_HPA"] }