Skip to content

Commit b734db5

Browse files
committed
Merge branch 'master' into fix/promethus-enable
2 parents 6aec917 + ae63848 commit b734db5

File tree

36 files changed

+124
-182
lines changed

36 files changed

+124
-182
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Then perform the following commands on the root folder:
141141
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |
142142
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
143143
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
144+
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
144145
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
145146
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
146147
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |

autogen/main/cluster.tf.tmpl

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -109,45 +109,22 @@ resource "google_container_cluster" "primary" {
109109
}
110110
{% if beta_cluster %}
111111
monitoring_service = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? null : var.monitoring_service
112-
dynamic "monitoring_config" {
113-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
114-
content{
115-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
116-
dynamic "managed_prometheus" {
117-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
118-
content {
119-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
120-
dynamic "managed_prometheus" {
121-
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
122-
content {
123-
enabled = var.monitoring_enable_managed_prometheus
124-
}
125-
}
126-
}
127-
}
128-
}
129-
}
130112
{% else %}
131113
monitoring_service = local.logmon_config_is_set ? null : var.monitoring_service
114+
{% endif %}
132115
dynamic "monitoring_config" {
116+
{% if beta_cluster %}
117+
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
118+
{% else %}
133119
for_each = local.logmon_config_is_set || local.logmon_config_is_set ? [1] : []
120+
{% endif %}
134121
content{
135-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
136-
dynamic "managed_prometheus" {
137-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
138-
content {
139-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
140-
dynamic "managed_prometheus" {
141-
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
142-
content {
143-
enabled = var.monitoring_enable_managed_prometheus
144-
}
145-
}
146-
}
122+
enable_components = var.monitoring_enabled_components
123+
managed_prometheus {
124+
enabled = var.monitoring_enable_managed_prometheus
147125
}
148126
}
149127
}
150-
{% endif %}
151128
cluster_autoscaling {
152129
enabled = var.cluster_autoscaling.enabled
153130
dynamic "auto_provisioning_defaults" {
@@ -307,6 +284,10 @@ resource "google_container_cluster" "primary" {
307284
enabled = gke_backup_agent_config.value.enabled
308285
}
309286
}
287+
288+
config_connector_config {
289+
enabled = var.config_connector
290+
}
310291
{% endif %}
311292
{% if beta_cluster and autopilot_cluster != true %}
312293

@@ -326,10 +307,6 @@ resource "google_container_cluster" "primary" {
326307
kalm_config {
327308
enabled = var.kalm_config
328309
}
329-
330-
config_connector_config {
331-
enabled = var.config_connector
332-
}
333310
{% endif %}
334311
}
335312
{% if autopilot_cluster != true %}

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,12 @@ variable "enable_kubernetes_alpha" {
711711
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."
712712
default = false
713713
}
714+
715+
variable "config_connector" {
716+
type = bool
717+
description = "Whether ConfigConnector is enabled for this cluster."
718+
default = false
719+
}
714720
{% endif %}
715721
{% if beta_cluster %}
716722
{% if autopilot_cluster != true %}
@@ -733,12 +739,6 @@ variable "kalm_config" {
733739
default = false
734740
}
735741

736-
variable "config_connector" {
737-
type = bool
738-
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
739-
default = false
740-
}
741-
742742
variable "cloudrun" {
743743
description = "(Beta) Enable CloudRun addon"
744744
type = bool

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ variable "firewall_inbound_ports" {
453453

454454
variable "config_connector" {
455455
type = bool
456-
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
456+
description = "Whether ConfigConnector is enabled for this cluster."
457457
default = false
458458
}
459459

cluster.tf

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,9 @@ resource "google_container_cluster" "primary" {
8484
dynamic "monitoring_config" {
8585
for_each = local.logmon_config_is_set || local.logmon_config_is_set ? [1] : []
8686
content {
87-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
88-
dynamic "managed_prometheus" {
89-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
90-
content {
91-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
92-
dynamic "managed_prometheus" {
93-
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
94-
content {
95-
enabled = var.monitoring_enable_managed_prometheus
96-
}
97-
}
98-
}
87+
enable_components = var.monitoring_enabled_components
88+
managed_prometheus {
89+
enabled = var.monitoring_enable_managed_prometheus
9990
}
10091
}
10192
}
@@ -204,6 +195,10 @@ resource "google_container_cluster" "primary" {
204195
enabled = gke_backup_agent_config.value.enabled
205196
}
206197
}
198+
199+
config_connector_config {
200+
enabled = var.config_connector
201+
}
207202
}
208203

209204
datapath_provider = var.datapath_provider

modules/beta-private-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Then perform the following commands on the root folder:
176176
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
177177
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
178178
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
179-
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
179+
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
180180
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
181181
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
182182
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,9 @@ resource "google_container_cluster" "primary" {
9696
dynamic "monitoring_config" {
9797
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
9898
content {
99-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
100-
dynamic "managed_prometheus" {
101-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
102-
content {
103-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
104-
dynamic "managed_prometheus" {
105-
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
106-
content {
107-
enabled = var.monitoring_enable_managed_prometheus
108-
}
109-
}
110-
}
99+
enable_components = var.monitoring_enabled_components
100+
managed_prometheus {
101+
enabled = var.monitoring_enable_managed_prometheus
111102
}
112103
}
113104
}
@@ -237,6 +228,10 @@ resource "google_container_cluster" "primary" {
237228
}
238229
}
239230

231+
config_connector_config {
232+
enabled = var.config_connector
233+
}
234+
240235
istio_config {
241236
disabled = !var.istio
242237
auth = var.istio_auth
@@ -253,10 +248,6 @@ resource "google_container_cluster" "primary" {
253248
kalm_config {
254249
enabled = var.kalm_config
255250
}
256-
257-
config_connector_config {
258-
enabled = var.config_connector
259-
}
260251
}
261252

262253
datapath_provider = var.datapath_provider

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,12 @@ variable "enable_kubernetes_alpha" {
674674
default = false
675675
}
676676

677+
variable "config_connector" {
678+
type = bool
679+
description = "Whether ConfigConnector is enabled for this cluster."
680+
default = false
681+
}
682+
677683
variable "istio" {
678684
description = "(Beta) Enable Istio addon"
679685
type = bool
@@ -692,12 +698,6 @@ variable "kalm_config" {
692698
default = false
693699
}
694700

695-
variable "config_connector" {
696-
type = bool
697-
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
698-
default = false
699-
}
700-
701701
variable "cloudrun" {
702702
description = "(Beta) Enable CloudRun addon"
703703
type = bool

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Then perform the following commands on the root folder:
154154
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
155155
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
156156
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
157-
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
157+
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
158158
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
159159
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
160160
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |

modules/beta-private-cluster/cluster.tf

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,9 @@ resource "google_container_cluster" "primary" {
9696
dynamic "monitoring_config" {
9797
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
9898
content {
99-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
100-
dynamic "managed_prometheus" {
101-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
102-
content {
103-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
104-
dynamic "managed_prometheus" {
105-
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
106-
content {
107-
enabled = var.monitoring_enable_managed_prometheus
108-
}
109-
}
110-
}
99+
enable_components = var.monitoring_enabled_components
100+
managed_prometheus {
101+
enabled = var.monitoring_enable_managed_prometheus
111102
}
112103
}
113104
}
@@ -237,6 +228,10 @@ resource "google_container_cluster" "primary" {
237228
}
238229
}
239230

231+
config_connector_config {
232+
enabled = var.config_connector
233+
}
234+
240235
istio_config {
241236
disabled = !var.istio
242237
auth = var.istio_auth
@@ -253,10 +248,6 @@ resource "google_container_cluster" "primary" {
253248
kalm_config {
254249
enabled = var.kalm_config
255250
}
256-
257-
config_connector_config {
258-
enabled = var.config_connector
259-
}
260251
}
261252

262253
datapath_provider = var.datapath_provider

modules/beta-private-cluster/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,12 @@ variable "enable_kubernetes_alpha" {
674674
default = false
675675
}
676676

677+
variable "config_connector" {
678+
type = bool
679+
description = "Whether ConfigConnector is enabled for this cluster."
680+
default = false
681+
}
682+
677683
variable "istio" {
678684
description = "(Beta) Enable Istio addon"
679685
type = bool
@@ -692,12 +698,6 @@ variable "kalm_config" {
692698
default = false
693699
}
694700

695-
variable "config_connector" {
696-
type = bool
697-
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
698-
default = false
699-
}
700-
701701
variable "cloudrun" {
702702
description = "(Beta) Enable CloudRun addon"
703703
type = bool

modules/beta-public-cluster-update-variant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ Then perform the following commands on the root folder:
170170
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
171171
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
172172
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
173-
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
173+
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
174174
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
175175
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
176176
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,9 @@ resource "google_container_cluster" "primary" {
9696
dynamic "monitoring_config" {
9797
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
9898
content {
99-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
100-
dynamic "managed_prometheus" {
101-
for_each = local.cluster_telemetry_type_is_set || local.logmon_config_is_set ? [1] : []
102-
content {
103-
enable_components = length(var.monitoring_enabled_components) > 0 ? var.monitoring_enabled_components : []
104-
dynamic "managed_prometheus" {
105-
for_each = var.monitoring_enable_managed_prometheus ? [1] : []
106-
content {
107-
enabled = var.monitoring_enable_managed_prometheus
108-
}
109-
}
110-
}
99+
enable_components = var.monitoring_enabled_components
100+
managed_prometheus {
101+
enabled = var.monitoring_enable_managed_prometheus
111102
}
112103
}
113104
}
@@ -237,6 +228,10 @@ resource "google_container_cluster" "primary" {
237228
}
238229
}
239230

231+
config_connector_config {
232+
enabled = var.config_connector
233+
}
234+
240235
istio_config {
241236
disabled = !var.istio
242237
auth = var.istio_auth
@@ -253,10 +248,6 @@ resource "google_container_cluster" "primary" {
253248
kalm_config {
254249
enabled = var.kalm_config
255250
}
256-
257-
config_connector_config {
258-
enabled = var.config_connector
259-
}
260251
}
261252

262253
datapath_provider = var.datapath_provider

modules/beta-public-cluster-update-variant/variables.tf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,12 @@ variable "enable_kubernetes_alpha" {
644644
default = false
645645
}
646646

647+
variable "config_connector" {
648+
type = bool
649+
description = "Whether ConfigConnector is enabled for this cluster."
650+
default = false
651+
}
652+
647653
variable "istio" {
648654
description = "(Beta) Enable Istio addon"
649655
type = bool
@@ -662,12 +668,6 @@ variable "kalm_config" {
662668
default = false
663669
}
664670

665-
variable "config_connector" {
666-
type = bool
667-
description = "(Beta) Whether ConfigConnector is enabled for this cluster."
668-
default = false
669-
}
670-
671671
variable "cloudrun" {
672672
description = "(Beta) Enable CloudRun addon"
673673
type = bool

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Then perform the following commands on the root folder:
148148
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
149149
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
150150
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
151-
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
151+
| config\_connector | Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
152152
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
153153
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
154154
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` | <pre>[<br> {<br> "key_name": "",<br> "state": "DECRYPTED"<br> }<br>]</pre> | no |

0 commit comments

Comments
 (0)