Skip to content

Commit b54b7ba

Browse files
DrFaust92apeabody
andauthored
feat: add support for additive_vpc_scope_dns_domain (#1998)
Co-authored-by: Andrew Peabody <andrewpeabody@google.com>
1 parent 6bd1bc1 commit b54b7ba

File tree

14 files changed

+53
-15
lines changed

14 files changed

+53
-15
lines changed

Diff for: autogen/main/cluster.tf.tmpl

+6-3
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,12 @@ resource "google_container_cluster" "primary" {
466466
dynamic "dns_config" {
467467
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
468468
content {
469-
cluster_dns = var.cluster_dns_provider
470-
cluster_dns_scope = var.cluster_dns_scope
471-
cluster_dns_domain = var.cluster_dns_domain
469+
{% if beta_cluster %}
470+
additive_vpc_scope_dns_domain = var.additive_vpc_scope_dns_domain
471+
{% endif %}
472+
cluster_dns = var.cluster_dns_provider
473+
cluster_dns_scope = var.cluster_dns_scope
474+
cluster_dns_domain = var.cluster_dns_domain
472475
}
473476
}
474477

Diff for: autogen/main/variables.tf.tmpl

+7
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,13 @@ variable "cluster_dns_domain" {
741741
default = ""
742742
}
743743

744+
{% if beta_cluster %}
745+
variable "additive_vpc_scope_dns_domain" {
746+
type = string
747+
description = "(Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = `CLOUD_DNS` and cluster_dns_scope = `CLUSTER_SCOPE` must both be set as well."
748+
default = ""
749+
}
750+
{% endif %}
744751
variable "gce_pd_csi_driver" {
745752
type = bool
746753
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."

Diff for: modules/beta-private-cluster-update-variant/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Then perform the following commands on the root folder:
173173
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
174174
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
175175
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
176+
| additive\_vpc\_scope\_dns\_domain | (Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster\_dns = `CLOUD_DNS` and cluster\_dns\_scope = `CLUSTER_SCOPE` must both be set as well. | `string` | `""` | no |
176177
| 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 gke-security-groups@yourdomain.com | `string` | `null` | no |
177178
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
178179
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |

Diff for: modules/beta-private-cluster-update-variant/cluster.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,10 @@ resource "google_container_cluster" "primary" {
395395
dynamic "dns_config" {
396396
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
397397
content {
398-
cluster_dns = var.cluster_dns_provider
399-
cluster_dns_scope = var.cluster_dns_scope
400-
cluster_dns_domain = var.cluster_dns_domain
398+
additive_vpc_scope_dns_domain = var.additive_vpc_scope_dns_domain
399+
cluster_dns = var.cluster_dns_provider
400+
cluster_dns_scope = var.cluster_dns_scope
401+
cluster_dns_domain = var.cluster_dns_domain
401402
}
402403
}
403404

Diff for: modules/beta-private-cluster-update-variant/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,11 @@ variable "cluster_dns_domain" {
710710
default = ""
711711
}
712712

713+
variable "additive_vpc_scope_dns_domain" {
714+
type = string
715+
description = "(Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = `CLOUD_DNS` and cluster_dns_scope = `CLUSTER_SCOPE` must both be set as well."
716+
default = ""
717+
}
713718
variable "gce_pd_csi_driver" {
714719
type = bool
715720
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."

Diff for: modules/beta-private-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ Then perform the following commands on the root folder:
151151
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
152152
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
153153
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
154+
| additive\_vpc\_scope\_dns\_domain | (Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster\_dns = `CLOUD_DNS` and cluster\_dns\_scope = `CLUSTER_SCOPE` must both be set as well. | `string` | `""` | no |
154155
| 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 gke-security-groups@yourdomain.com | `string` | `null` | no |
155156
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
156157
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |

Diff for: modules/beta-private-cluster/cluster.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,10 @@ resource "google_container_cluster" "primary" {
395395
dynamic "dns_config" {
396396
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
397397
content {
398-
cluster_dns = var.cluster_dns_provider
399-
cluster_dns_scope = var.cluster_dns_scope
400-
cluster_dns_domain = var.cluster_dns_domain
398+
additive_vpc_scope_dns_domain = var.additive_vpc_scope_dns_domain
399+
cluster_dns = var.cluster_dns_provider
400+
cluster_dns_scope = var.cluster_dns_scope
401+
cluster_dns_domain = var.cluster_dns_domain
401402
}
402403
}
403404

Diff for: modules/beta-private-cluster/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,11 @@ variable "cluster_dns_domain" {
710710
default = ""
711711
}
712712

713+
variable "additive_vpc_scope_dns_domain" {
714+
type = string
715+
description = "(Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = `CLOUD_DNS` and cluster_dns_scope = `CLUSTER_SCOPE` must both be set as well."
716+
default = ""
717+
}
713718
variable "gce_pd_csi_driver" {
714719
type = bool
715720
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."

Diff for: modules/beta-public-cluster-update-variant/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ Then perform the following commands on the root folder:
167167
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
168168
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
169169
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
170+
| additive\_vpc\_scope\_dns\_domain | (Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster\_dns = `CLOUD_DNS` and cluster\_dns\_scope = `CLUSTER_SCOPE` must both be set as well. | `string` | `""` | no |
170171
| 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 gke-security-groups@yourdomain.com | `string` | `null` | no |
171172
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
172173
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |

Diff for: modules/beta-public-cluster-update-variant/cluster.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,10 @@ resource "google_container_cluster" "primary" {
395395
dynamic "dns_config" {
396396
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
397397
content {
398-
cluster_dns = var.cluster_dns_provider
399-
cluster_dns_scope = var.cluster_dns_scope
400-
cluster_dns_domain = var.cluster_dns_domain
398+
additive_vpc_scope_dns_domain = var.additive_vpc_scope_dns_domain
399+
cluster_dns = var.cluster_dns_provider
400+
cluster_dns_scope = var.cluster_dns_scope
401+
cluster_dns_domain = var.cluster_dns_domain
401402
}
402403
}
403404

Diff for: modules/beta-public-cluster-update-variant/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ variable "cluster_dns_domain" {
680680
default = ""
681681
}
682682

683+
variable "additive_vpc_scope_dns_domain" {
684+
type = string
685+
description = "(Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = `CLOUD_DNS` and cluster_dns_scope = `CLUSTER_SCOPE` must both be set as well."
686+
default = ""
687+
}
683688
variable "gce_pd_csi_driver" {
684689
type = bool
685690
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."

Diff for: modules/beta-public-cluster/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ Then perform the following commands on the root folder:
145145
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
146146
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
147147
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
148+
| additive\_vpc\_scope\_dns\_domain | (Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster\_dns = `CLOUD_DNS` and cluster\_dns\_scope = `CLUSTER_SCOPE` must both be set as well. | `string` | `""` | no |
148149
| 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 gke-security-groups@yourdomain.com | `string` | `null` | no |
149150
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |
150151
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |

Diff for: modules/beta-public-cluster/cluster.tf

+4-3
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,10 @@ resource "google_container_cluster" "primary" {
395395
dynamic "dns_config" {
396396
for_each = var.cluster_dns_provider == "CLOUD_DNS" ? [1] : []
397397
content {
398-
cluster_dns = var.cluster_dns_provider
399-
cluster_dns_scope = var.cluster_dns_scope
400-
cluster_dns_domain = var.cluster_dns_domain
398+
additive_vpc_scope_dns_domain = var.additive_vpc_scope_dns_domain
399+
cluster_dns = var.cluster_dns_provider
400+
cluster_dns_scope = var.cluster_dns_scope
401+
cluster_dns_domain = var.cluster_dns_domain
401402
}
402403
}
403404

Diff for: modules/beta-public-cluster/variables.tf

+5
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,11 @@ variable "cluster_dns_domain" {
680680
default = ""
681681
}
682682

683+
variable "additive_vpc_scope_dns_domain" {
684+
type = string
685+
description = "(Beta) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster_dns = `CLOUD_DNS` and cluster_dns_scope = `CLUSTER_SCOPE` must both be set as well."
686+
default = ""
687+
}
683688
variable "gce_pd_csi_driver" {
684689
type = bool
685690
description = "Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver."

0 commit comments

Comments
 (0)