Skip to content

Commit b26aa4c

Browse files
authored
Merge branch 'master' into ap/6.10
2 parents 0054772 + a78cc8c commit b26aa4c

File tree

27 files changed

+612
-408
lines changed

27 files changed

+612
-408
lines changed

.kitchen.yml

Lines changed: 0 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -32,57 +32,6 @@ platforms:
3232
- name: local
3333

3434
suites:
35-
- name: "shared_vpc"
36-
transport:
37-
root_module_directory: test/fixtures/shared_vpc
38-
verifier:
39-
systems:
40-
- name: shared_vpc
41-
backend: local
42-
- name: "safer_cluster"
43-
transport:
44-
root_module_directory: test/fixtures/safer_cluster
45-
verifier:
46-
systems:
47-
- name: safer_cluster
48-
backend: local
49-
controls:
50-
- gcloud
51-
- name: inspec-gcp
52-
backend: gcp
53-
controls:
54-
- network
55-
- name: "simple_regional"
56-
transport:
57-
root_module_directory: test/fixtures/simple_regional
58-
verifier:
59-
systems:
60-
- name: simple_regional
61-
backend: local
62-
- name: "simple_regional_with_networking"
63-
transport:
64-
root_module_directory: test/fixtures/simple_regional_with_networking
65-
verifier:
66-
systems:
67-
- name: simple_regional_with_networking
68-
backend: local
69-
controls:
70-
- gcloud
71-
- name: subnet
72-
backend: local
73-
controls:
74-
- subnet
75-
- name: network
76-
backend: gcp
77-
controls:
78-
- network
79-
- name: "simple_regional_private"
80-
transport:
81-
root_module_directory: test/fixtures/simple_regional_private
82-
verifier:
83-
systems:
84-
- name: simple_regional_private
85-
backend: local
8635
- name: "simple_regional_with_gateway_api"
8736
transport:
8837
root_module_directory: test/fixtures/simple_regional_with_gateway_api
@@ -97,36 +46,6 @@ suites:
9746
systems:
9847
- name: simple_regional_with_ipv6
9948
backend: local
100-
- name: "simple_regional_with_kubeconfig"
101-
transport:
102-
root_module_directory: test/fixtures/simple_regional_with_kubeconfig
103-
verifier:
104-
systems:
105-
- name: simple_regional_with_kubeconfig
106-
backend: local
107-
- name: "simple_zonal"
108-
transport:
109-
root_module_directory: test/fixtures/simple_zonal
110-
verifier:
111-
systems:
112-
- name: gcloud
113-
backend: local
114-
controls:
115-
- gcloud
116-
- acm
117-
- name: gcp
118-
backend: gcp
119-
controls:
120-
- gcp
121-
- name: "simple_zonal_private"
122-
transport:
123-
root_module_directory: test/fixtures/simple_zonal_private
124-
verifier:
125-
systems:
126-
- name: simple_zonal_private
127-
backend: local
128-
controls:
129-
- gcloud
13049
- name: "stub_domains"
13150
transport:
13251
root_module_directory: test/fixtures/stub_domains
@@ -179,29 +98,6 @@ suites:
17998
systems:
18099
- name: workload_metadata_config
181100
backend: local
182-
- name: "simple_windows_node_pool"
183-
transport:
184-
root_module_directory: test/fixtures/simple_windows_node_pool
185-
verifier:
186-
systems:
187-
- name: gcloud
188-
backend: local
189-
controls:
190-
- gcloud
191-
- name: gcp
192-
backend: gcp
193-
controls:
194-
- gcp
195-
- name: "deploy_service"
196-
transport:
197-
root_module_directory: test/fixtures/deploy_service
198-
verifier:
199-
systems:
200-
- name: deploy_service
201-
backend: local
202-
controls:
203-
- gcloud
204-
- kubectl
205101
- name: "node_pool"
206102
transport:
207103
root_module_directory: test/fixtures/node_pool
@@ -212,41 +108,10 @@ suites:
212108
controls:
213109
- gcloud
214110
- kubectl
215-
- name: "sandbox_enabled"
216-
transport:
217-
root_module_directory: test/fixtures/sandbox_enabled
218-
verifier:
219-
systems:
220-
- name: sandbox_enabled
221-
backend: local
222111
- name: "safer_cluster_iap_bastion"
223112
transport:
224113
root_module_directory: test/fixtures/safer_cluster_iap_bastion
225114
verifier:
226115
systems:
227116
- name: safer_cluster_iap_bastion
228117
backend: local
229-
- name: "simple_zonal_with_asm"
230-
transport:
231-
root_module_directory: test/fixtures/simple_zonal_with_asm
232-
verifier:
233-
systems:
234-
- name: simple_zonal_with_asm
235-
backend: local
236-
controls:
237-
- gcloud
238-
- kubectl
239-
- name: "simple_autopilot_private"
240-
transport:
241-
root_module_directory: test/fixtures/simple_autopilot_private
242-
verifier:
243-
systems:
244-
- name: simple_autopilot_private
245-
backend: local
246-
- name: "simple_autopilot_public"
247-
transport:
248-
root_module_directory: test/fixtures/simple_autopilot_public
249-
verifier:
250-
systems:
251-
- name: simple_autopilot_public
252-
backend: local

autogen/main/cluster.tf.tmpl

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -94,42 +94,51 @@ resource "google_container_cluster" "primary" {
9494
}
9595
}
9696
{% endif %}
97-
{% if autopilot_cluster != true %}
98-
# only one of logging/monitoring_service or logging/monitoring_config can be specified
99-
{% if beta_cluster %}
100-
logging_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.logging_service
101-
{% else %}
102-
logging_service = local.logmon_config_is_set ? null : var.logging_service
103-
{% endif %}
10497
dynamic "logging_config" {
10598
for_each = length(var.logging_enabled_components) > 0 ? [1] : []
10699

107100
content {
108101
enable_components = var.logging_enabled_components
109102
}
110103
}
111-
{% if beta_cluster %}
112-
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service
113-
{% else %}
114-
monitoring_service = local.logmon_config_is_set ? null : var.monitoring_service
115-
{% endif %}
104+
116105
dynamic "monitoring_config" {
106+
{% if autopilot_cluster != true %}
117107
{% if beta_cluster %}
118108
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
119109
{% else %}
120110
for_each = local.logmon_config_is_set || local.logmon_config_is_set ? [1] : []
121111
{% endif %}
112+
{% else %}
113+
for_each = length(var.monitoring_enabled_components) > 0 ? [1] : []
114+
{% endif %}
122115
content{
123116
enable_components = var.monitoring_enabled_components
117+
{% if autopilot_cluster != true %}
124118
managed_prometheus {
125119
enabled = var.monitoring_enable_managed_prometheus
126120
}
127121
advanced_datapath_observability_config {
128122
enable_metrics = var.monitoring_enable_observability_metrics
129123
enable_relay = var.monitoring_enable_observability_relay
130124
}
125+
{% endif %}
131126
}
132127
}
128+
129+
{% if autopilot_cluster != true %}
130+
# only one of logging/monitoring_service or logging/monitoring_config can be specified
131+
{% if beta_cluster %}
132+
logging_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.logging_service
133+
{% else %}
134+
logging_service = local.logmon_config_is_set ? null : var.logging_service
135+
{% endif %}
136+
{% if beta_cluster %}
137+
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service
138+
{% else %}
139+
monitoring_service = local.logmon_config_is_set ? null : var.monitoring_service
140+
{% endif %}
141+
133142
cluster_autoscaling {
134143
enabled = var.cluster_autoscaling.enabled
135144
dynamic "auto_provisioning_defaults" {

autogen/main/variables.tf.tmpl

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,53 @@ variable "timeouts" {
852852
}
853853
}
854854

855+
variable "monitoring_enabled_components" {
856+
type = list(string)
857+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
858+
default = []
859+
validation {
860+
condition = alltrue([
861+
for c in var.monitoring_enabled_components:
862+
contains([
863+
"SYSTEM_COMPONENTS",
864+
"APISERVER",
865+
"SCHEDULER",
866+
"CONTROLLER_MANAGER",
867+
"STORAGE",
868+
"HPA",
869+
"POD",
870+
"DAEMONSET",
871+
"DEPLOYMENT",
872+
"STATEFULSET",
873+
"WORKLOADS",
874+
"KUBELET",
875+
"CADVISOR",
876+
"DCGM"
877+
], c)
878+
])
879+
error_message = "Valid values are SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, WORKLOADS, KUBELET, CADVISOR and DCGM."
880+
}
881+
}
882+
883+
variable "logging_enabled_components" {
884+
type = list(string)
885+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
886+
default = []
887+
validation {
888+
condition = alltrue([
889+
for c in var.logging_enabled_components:
890+
contains([
891+
"SYSTEM_COMPONENTS",
892+
"APISERVER",
893+
"CONTROLLER_MANAGER",
894+
"SCHEDULER",
895+
"WORKLOADS"
896+
], c)
897+
])
898+
error_message = "Valid values are SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS."
899+
}
900+
}
901+
855902
{% if autopilot_cluster != true %}
856903
variable "monitoring_enable_managed_prometheus" {
857904
type = bool
@@ -871,18 +918,6 @@ variable "monitoring_enable_observability_relay" {
871918
default = false
872919
}
873920

874-
variable "monitoring_enabled_components" {
875-
type = list(string)
876-
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
877-
default = []
878-
}
879-
880-
variable "logging_enabled_components" {
881-
type = list(string)
882-
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
883-
default = []
884-
}
885-
886921
variable "enable_kubernetes_alpha" {
887922
type = bool
888923
description = "Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days."

0 commit comments

Comments
 (0)