Skip to content

Commit 4bf0011

Browse files
feat: cloud-dns support (#1317)
* cloud-dns support * fix * lint * autopilot Co-authored-by: Bharath KKB <[email protected]>
1 parent 35b2bf5 commit 4bf0011

File tree

23 files changed

+241
-0
lines changed

23 files changed

+241
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ Then perform the following commands on the root folder:
133133
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
134134
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
135135
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> })</pre> | <pre>{<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
136+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
137+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
138+
| 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 |
136139
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
137140
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
138141
| 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 |

autogen/main/cluster.tf.tmpl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,17 @@ resource "google_container_cluster" "primary" {
309309
}
310310
{% endif %}
311311

312+
{% if autopilot_cluster != true %}
313+
dynamic "dns_config" {
314+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
315+
content {
316+
cluster_dns = var.cluster_dns_provider
317+
cluster_dns_scope = var.cluster_dns_scope
318+
cluster_dns_domain = var.cluster_dns_domain
319+
}
320+
}
321+
322+
{% endif %}
312323
timeouts {
313324
create = lookup(var.timeouts, "create", "45m")
314325
update = lookup(var.timeouts, "update", "45m")

autogen/main/variables.tf.tmpl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,26 @@ variable "node_metadata" {
574574
}
575575
{% endif %}
576576

577+
{% if autopilot_cluster != true %}
578+
variable "cluster_dns_provider" {
579+
type = string
580+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
581+
default = "PROVIDER_UNSPECIFIED"
582+
}
583+
584+
variable "cluster_dns_scope" {
585+
type = string
586+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
587+
default = "DNS_SCOPE_UNSPECIFIED"
588+
}
589+
590+
variable "cluster_dns_domain" {
591+
type = string
592+
description = "The suffix used for all cluster service records."
593+
default = ""
594+
}
595+
596+
{% endif %}
577597
variable "timeouts" {
578598
type = map(string)
579599
description = "Timeout for cluster operations."

cluster.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ resource "google_container_cluster" "primary" {
161161
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"], resource_labels["mesh_id"]]
162162
}
163163

164+
dynamic "dns_config" {
165+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
166+
content {
167+
cluster_dns = var.cluster_dns_provider
168+
cluster_dns_scope = var.cluster_dns_scope
169+
cluster_dns_domain = var.cluster_dns_domain
170+
}
171+
}
172+
164173
timeouts {
165174
create = lookup(var.timeouts, "create", "45m")
166175
update = lookup(var.timeouts, "update", "45m")

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ Then perform the following commands on the root folder:
167167
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
168168
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | no |
169169
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
170+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
171+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
172+
| 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 |
170173
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
171174
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
172175
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ resource "google_container_cluster" "primary" {
262262
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"], resource_labels["mesh_id"]]
263263
}
264264

265+
dynamic "dns_config" {
266+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
267+
content {
268+
cluster_dns = var.cluster_dns_provider
269+
cluster_dns_scope = var.cluster_dns_scope
270+
cluster_dns_domain = var.cluster_dns_domain
271+
}
272+
}
273+
265274
timeouts {
266275
create = lookup(var.timeouts, "create", "45m")
267276
update = lookup(var.timeouts, "update", "45m")

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,24 @@ variable "node_metadata" {
544544
}
545545
}
546546

547+
variable "cluster_dns_provider" {
548+
type = string
549+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
550+
default = "PROVIDER_UNSPECIFIED"
551+
}
552+
553+
variable "cluster_dns_scope" {
554+
type = string
555+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
556+
default = "DNS_SCOPE_UNSPECIFIED"
557+
}
558+
559+
variable "cluster_dns_domain" {
560+
type = string
561+
description = "The suffix used for all cluster service records."
562+
default = ""
563+
}
564+
547565
variable "timeouts" {
548566
type = map(string)
549567
description = "Timeout for cluster operations."

modules/beta-private-cluster/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ Then perform the following commands on the root folder:
145145
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
146146
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | no |
147147
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
148+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
149+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
150+
| 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 |
148151
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
149152
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
150153
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |

modules/beta-private-cluster/cluster.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ resource "google_container_cluster" "primary" {
262262
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"], resource_labels["mesh_id"]]
263263
}
264264

265+
dynamic "dns_config" {
266+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
267+
content {
268+
cluster_dns = var.cluster_dns_provider
269+
cluster_dns_scope = var.cluster_dns_scope
270+
cluster_dns_domain = var.cluster_dns_domain
271+
}
272+
}
273+
265274
timeouts {
266275
create = lookup(var.timeouts, "create", "45m")
267276
update = lookup(var.timeouts, "update", "45m")

modules/beta-private-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,24 @@ variable "node_metadata" {
544544
}
545545
}
546546

547+
variable "cluster_dns_provider" {
548+
type = string
549+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
550+
default = "PROVIDER_UNSPECIFIED"
551+
}
552+
553+
variable "cluster_dns_scope" {
554+
type = string
555+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
556+
default = "DNS_SCOPE_UNSPECIFIED"
557+
}
558+
559+
variable "cluster_dns_domain" {
560+
type = string
561+
description = "The suffix used for all cluster service records."
562+
default = ""
563+
}
564+
547565
variable "timeouts" {
548566
type = map(string)
549567
description = "Timeout for cluster operations."

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ Then perform the following commands on the root folder:
161161
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
162162
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | no |
163163
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
164+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
165+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
166+
| 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 |
164167
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
165168
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
166169
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ resource "google_container_cluster" "primary" {
262262
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"], resource_labels["mesh_id"]]
263263
}
264264

265+
dynamic "dns_config" {
266+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
267+
content {
268+
cluster_dns = var.cluster_dns_provider
269+
cluster_dns_scope = var.cluster_dns_scope
270+
cluster_dns_domain = var.cluster_dns_domain
271+
}
272+
}
273+
265274
timeouts {
266275
create = lookup(var.timeouts, "create", "45m")
267276
update = lookup(var.timeouts, "update", "45m")

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,24 @@ variable "node_metadata" {
513513
}
514514
}
515515

516+
variable "cluster_dns_provider" {
517+
type = string
518+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
519+
default = "PROVIDER_UNSPECIFIED"
520+
}
521+
522+
variable "cluster_dns_scope" {
523+
type = string
524+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
525+
default = "DNS_SCOPE_UNSPECIFIED"
526+
}
527+
528+
variable "cluster_dns_domain" {
529+
type = string
530+
description = "The suffix used for all cluster service records."
531+
default = ""
532+
}
533+
516534
variable "timeouts" {
517535
type = map(string)
518536
description = "Timeout for cluster operations."

modules/beta-public-cluster/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ Then perform the following commands on the root folder:
139139
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
140140
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | no |
141141
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> autoscaling_profile = string<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> })</pre> | <pre>{<br> "autoscaling_profile": "BALANCED",<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
142+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
143+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
144+
| 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 |
142145
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
143146
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
144147
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |

modules/beta-public-cluster/cluster.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ resource "google_container_cluster" "primary" {
262262
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"], resource_labels["mesh_id"]]
263263
}
264264

265+
dynamic "dns_config" {
266+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
267+
content {
268+
cluster_dns = var.cluster_dns_provider
269+
cluster_dns_scope = var.cluster_dns_scope
270+
cluster_dns_domain = var.cluster_dns_domain
271+
}
272+
}
273+
265274
timeouts {
266275
create = lookup(var.timeouts, "create", "45m")
267276
update = lookup(var.timeouts, "update", "45m")

modules/beta-public-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,24 @@ variable "node_metadata" {
513513
}
514514
}
515515

516+
variable "cluster_dns_provider" {
517+
type = string
518+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
519+
default = "PROVIDER_UNSPECIFIED"
520+
}
521+
522+
variable "cluster_dns_scope" {
523+
type = string
524+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
525+
default = "DNS_SCOPE_UNSPECIFIED"
526+
}
527+
528+
variable "cluster_dns_domain" {
529+
type = string
530+
description = "The suffix used for all cluster service records."
531+
default = ""
532+
}
533+
516534
variable "timeouts" {
517535
type = map(string)
518536
description = "Timeout for cluster operations."

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ Then perform the following commands on the root folder:
161161
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
162162
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
163163
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) | <pre>object({<br> enabled = bool<br> min_cpu_cores = number<br> max_cpu_cores = number<br> min_memory_gb = number<br> max_memory_gb = number<br> gpu_resources = list(object({ resource_type = string, minimum = number, maximum = number }))<br> })</pre> | <pre>{<br> "enabled": false,<br> "gpu_resources": [],<br> "max_cpu_cores": 0,<br> "max_memory_gb": 0,<br> "min_cpu_cores": 0,<br> "min_memory_gb": 0<br>}</pre> | no |
164+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
165+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
166+
| 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 |
164167
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
165168
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
166169
| 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 |

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ resource "google_container_cluster" "primary" {
161161
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"], resource_labels["mesh_id"]]
162162
}
163163

164+
dynamic "dns_config" {
165+
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
166+
content {
167+
cluster_dns = var.cluster_dns_provider
168+
cluster_dns_scope = var.cluster_dns_scope
169+
cluster_dns_domain = var.cluster_dns_domain
170+
}
171+
}
172+
164173
timeouts {
165174
create = lookup(var.timeouts, "create", "45m")
166175
update = lookup(var.timeouts, "update", "45m")

0 commit comments

Comments
 (0)