Skip to content

Commit 4e817be

Browse files
feat: cloud dns support for safer clusters (terraform-google-modules#1384)
1 parent b9287de commit 4e817be

File tree

8 files changed

+78
-0
lines changed

8 files changed

+78
-0
lines changed

autogen/safer-cluster/main.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ module "gke" {
141141

142142
dns_cache = var.dns_cache
143143

144+
cluster_dns_provider = var.cluster_dns_provider
145+
146+
cluster_dns_scope = var.cluster_dns_scope
147+
148+
cluster_dns_domain = var.cluster_dns_domain
149+
144150
config_connector = var.config_connector
145151

146152
default_max_pods_per_node = var.default_max_pods_per_node

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,24 @@ variable "dns_cache" {
273273
default = false
274274
}
275275

276+
variable "cluster_dns_provider" {
277+
type = string
278+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
279+
default = "PROVIDER_UNSPECIFIED"
280+
}
281+
282+
variable "cluster_dns_scope" {
283+
type = string
284+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
285+
default = "DNS_SCOPE_UNSPECIFIED"
286+
}
287+
288+
variable "cluster_dns_domain" {
289+
type = string
290+
description = "The suffix used for all cluster service records."
291+
default = ""
292+
}
293+
276294
variable "default_max_pods_per_node" {
277295
description = "The maximum number of pods to schedule per node"
278296
default = 110

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ For simplicity, we suggest using `roles/container.admin` and
204204
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
205205
| 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 |
206206
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
207+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
208+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
209+
| 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 |
207210
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
208211
| compute\_engine\_service\_account | Use the given service account for nodes rather than creating a new dedicated service account. | `string` | `""` | no |
209212
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |

modules/safer-cluster-update-variant/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ module "gke" {
137137

138138
dns_cache = var.dns_cache
139139

140+
cluster_dns_provider = var.cluster_dns_provider
141+
142+
cluster_dns_scope = var.cluster_dns_scope
143+
144+
cluster_dns_domain = var.cluster_dns_domain
145+
140146
config_connector = var.config_connector
141147

142148
default_max_pods_per_node = var.default_max_pods_per_node

modules/safer-cluster-update-variant/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,24 @@ variable "dns_cache" {
273273
default = false
274274
}
275275

276+
variable "cluster_dns_provider" {
277+
type = string
278+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
279+
default = "PROVIDER_UNSPECIFIED"
280+
}
281+
282+
variable "cluster_dns_scope" {
283+
type = string
284+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
285+
default = "DNS_SCOPE_UNSPECIFIED"
286+
}
287+
288+
variable "cluster_dns_domain" {
289+
type = string
290+
description = "The suffix used for all cluster service records."
291+
default = ""
292+
}
293+
276294
variable "default_max_pods_per_node" {
277295
description = "The maximum number of pods to schedule per node"
278296
default = 110

modules/safer-cluster/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ For simplicity, we suggest using `roles/container.admin` and
204204
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
205205
| 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 |
206206
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
207+
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
208+
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
209+
| 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 |
207210
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
208211
| compute\_engine\_service\_account | Use the given service account for nodes rather than creating a new dedicated service account. | `string` | `""` | no |
209212
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |

modules/safer-cluster/main.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,12 @@ module "gke" {
137137

138138
dns_cache = var.dns_cache
139139

140+
cluster_dns_provider = var.cluster_dns_provider
141+
142+
cluster_dns_scope = var.cluster_dns_scope
143+
144+
cluster_dns_domain = var.cluster_dns_domain
145+
140146
config_connector = var.config_connector
141147

142148
default_max_pods_per_node = var.default_max_pods_per_node

modules/safer-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,24 @@ variable "dns_cache" {
273273
default = false
274274
}
275275

276+
variable "cluster_dns_provider" {
277+
type = string
278+
description = "Which in-cluster DNS provider should be used. PROVIDER_UNSPECIFIED (default) or PLATFORM_DEFAULT or CLOUD_DNS."
279+
default = "PROVIDER_UNSPECIFIED"
280+
}
281+
282+
variable "cluster_dns_scope" {
283+
type = string
284+
description = "The scope of access to cluster DNS records. DNS_SCOPE_UNSPECIFIED (default) or CLUSTER_SCOPE or VPC_SCOPE. "
285+
default = "DNS_SCOPE_UNSPECIFIED"
286+
}
287+
288+
variable "cluster_dns_domain" {
289+
type = string
290+
description = "The suffix used for all cluster service records."
291+
default = ""
292+
}
293+
276294
variable "default_max_pods_per_node" {
277295
description = "The maximum number of pods to schedule per node"
278296
default = 110

0 commit comments

Comments
 (0)