Skip to content

Commit de8e1d5

Browse files
authored
feat: Add support for enabling Nodelocal dns cache (var.dns_cache) (#477)
* added support for node local dns cache * config block * updates to testing Signed-off-by: Jonathan Meyers <[email protected]> * generate docs again for example change
1 parent 1883311 commit de8e1d5

File tree

41 files changed

+130
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+130
-12
lines changed

autogen/main/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ module "gke" {
8484
{% if beta_cluster %}
8585
istio = true
8686
cloudrun = true
87+
dns_cache = false
8788
{% endif %}
8889
8990
node_pools = [

autogen/main/cluster.tf.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ resource "google_container_cluster" "primary" {
157157
disabled = cloudrun_config.value.disabled
158158
}
159159
}
160+
161+
dns_cache_config {
162+
enabled = var.dns_cache
163+
}
160164
{% endif %}
161165
}
162166

autogen/main/main.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ locals {
160160
# BETA features
161161
cluster_istio_enabled = ! local.cluster_output_istio_disabled
162162
cluster_cloudrun_enabled = var.cloudrun
163+
cluster_dns_cache_enabled = var.dns_cache
163164
cluster_pod_security_policy_enabled = local.cluster_output_pod_security_policy_enabled
164165
cluster_intranode_visibility_enabled = local.cluster_output_intranode_visbility_enabled
165166
cluster_vertical_pod_autoscaling_enabled = local.cluster_output_vertical_pod_autoscaling_enabled

autogen/main/outputs.tf.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ output "cloudrun_enabled" {
138138
value = local.cluster_cloudrun_enabled
139139
}
140140

141+
output "dns_cache_enabled" {
142+
description = "Whether DNS Cache enabled"
143+
value = local.cluster_dns_cache_enabled
144+
}
145+
141146
output "pod_security_policy_enabled" {
142147
description = "Whether pod security policy is enabled"
143148
value = local.cluster_pod_security_policy_enabled

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,12 @@ variable "istio_auth" {
399399
default = "AUTH_MUTUAL_TLS"
400400
}
401401

402+
variable "dns_cache" {
403+
type = bool
404+
description = "(Beta) The status of the NodeLocal DNSCache addon."
405+
default = false
406+
}
407+
402408
variable "database_encryption" {
403409
description = "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."
404410
type = list(object({ state = string, key_name = string }))

autogen/safer-cluster/main.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ module "gke" {
122122

123123
cloudrun = var.cloudrun
124124

125+
dns_cache = var.dns_cache
126+
125127
default_max_pods_per_node = var.default_max_pods_per_node
126128

127129
database_encryption = var.database_encryption

autogen/safer-cluster/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ variable "istio_auth" {
237237
default = "AUTH_MUTUAL_TLS"
238238
}
239239

240+
variable "dns_cache" {
241+
type = bool
242+
description = "(Beta) The status of the NodeLocal DNSCache addon."
243+
default = false
244+
}
245+
240246
variable "default_max_pods_per_node" {
241247
description = "The maximum number of pods to schedule per node"
242248
default = 110

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.12.0"
22+
version = "~> 3.14.0"
2323
region = var.region
2424
}
2525

examples/node_pool_update_variant/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google" {
22-
version = "~> 3.12.0"
22+
version = "~> 3.14.0"
2323
region = var.region
2424
}
2525

examples/node_pool_update_variant_beta/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ locals {
1919
}
2020

2121
provider "google-beta" {
22-
version = "~> 3.12.0"
22+
version = "~> 3.14.0"
2323
credentials = file(var.credentials_path)
2424
region = var.region
2525
}

0 commit comments

Comments
 (0)