Skip to content

Commit 8e2d9fe

Browse files
author
Patrick Ziegler
committed
fix: set CLOUD_DNS as provider for gke autopilot cluster
> Starting in August 2023, the default DNS provider for your new GKE Autopilot > clusters using version 1.25.9-gke.400 or later and 1.26.4-gke.500 or later > becomes Cloud DNS, at no extra charge. This change will be gradual and > expected to be completed by Aug 12th. Without this change, the default setting `PROVIDER_UNSPECIFIED` for `dns_config.cluster_dns` is used with the `google_container_cluster` ressource. Thus running terraform apply to update parts of an deployment will always recreate the cluster: ``` - dns_config { # forces replacement - cluster_dns = "CLOUD_DNS" -> null - cluster_dns_domain = "cluster.local" -> null - cluster_dns_scope = "CLUSTER_SCOPE" -> null } ```
1 parent fd233e5 commit 8e2d9fe

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

modules/beta-autopilot-private-cluster/cluster.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ resource "google_container_cluster" "primary" {
135135
}
136136
workload_vulnerability_mode = var.workload_vulnerability_mode
137137
}
138+
139+
dns_config {
140+
cluster_dns = "CLOUD_DNS"
141+
cluster_dns_domain = "cluster.local"
142+
cluster_dns_scope = "CLUSTER_SCOPE"
143+
}
144+
138145
ip_allocation_policy {
139146
cluster_secondary_range_name = var.ip_range_pods
140147
services_secondary_range_name = var.ip_range_services

modules/beta-autopilot-public-cluster/cluster.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ resource "google_container_cluster" "primary" {
135135
}
136136
workload_vulnerability_mode = var.workload_vulnerability_mode
137137
}
138+
139+
dns_config {
140+
cluster_dns = "CLOUD_DNS"
141+
cluster_dns_domain = "cluster.local"
142+
cluster_dns_scope = "CLUSTER_SCOPE"
143+
}
144+
138145
ip_allocation_policy {
139146
cluster_secondary_range_name = var.ip_range_pods
140147
services_secondary_range_name = var.ip_range_services

0 commit comments

Comments
 (0)