Skip to content

Commit 2beb720

Browse files
authored
feat(TPG>=4.81.0)!: add fqdn policies (#1729)
1 parent 47477d6 commit 2beb720

File tree

27 files changed

+77
-20
lines changed

27 files changed

+77
-20
lines changed

autogen/main/cluster.tf.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ resource "google_container_cluster" "primary" {
208208
enable_l4_ilb_subsetting = var.enable_l4_ilb_subsetting
209209
{% endif %}
210210
{% endif %}
211+
{% if beta_cluster %}
212+
enable_fqdn_network_policy = var.enable_fqdn_network_policy
213+
{% endif %}
211214
{% if autopilot_cluster %}
212215
enable_autopilot = true
213216
{% endif %}

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,12 @@ variable "workload_config_audit_mode" {
560560
type = string
561561
default = "DISABLED"
562562
}
563+
564+
variable "enable_fqdn_network_policy" {
565+
type = bool
566+
description = "Enable FQDN Network Policies on the cluster"
567+
default = null
568+
}
563569
{% endif %}
564570

565571
variable "disable_default_snat" {

autogen/main/versions.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ terraform {
2424
required_providers {
2525
google = {
2626
source = "hashicorp/google"
27-
version = ">= 4.80.0, < 5.0, !=4.65.0, !=4.65.1"
27+
version = ">= 4.81.0, < 5.0, !=4.65.0, !=4.65.1"
2828
}
2929
google-beta = {
3030
source = "hashicorp/google-beta"
31-
version = ">= 4.80.0, < 5.0, !=4.65.0, !=4.65.1"
31+
version = ">= 4.81.0, < 5.0, !=4.65.0, !=4.65.1"
3232
}
3333
kubernetes = {
3434
source = "hashicorp/kubernetes"

modules/beta-autopilot-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Then perform the following commands on the root folder:
8787
| dns\_cache | The status of the NodeLocal DNSCache addon. | `bool` | `true` | no |
8888
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
8989
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
90+
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
9091
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
9192
| enable\_private\_endpoint | (Beta) Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
9293
| enable\_private\_nodes | (Beta) Whether nodes have internal IP addresses only | `bool` | `false` | no |

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ resource "google_container_cluster" "primary" {
8181
vertical_pod_autoscaling {
8282
enabled = var.enable_vertical_pod_autoscaling
8383
}
84-
enable_autopilot = true
84+
enable_fqdn_network_policy = var.enable_fqdn_network_policy
85+
enable_autopilot = true
8586
dynamic "master_authorized_networks_config" {
8687
for_each = local.master_authorized_networks_config
8788
content {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,12 @@ variable "workload_config_audit_mode" {
386386
default = "DISABLED"
387387
}
388388

389+
variable "enable_fqdn_network_policy" {
390+
type = bool
391+
description = "Enable FQDN Network Policies on the cluster"
392+
default = null
393+
}
394+
389395
variable "disable_default_snat" {
390396
type = bool
391397
description = "Whether to disable the default SNAT to support the private use of public IP addresses"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ terraform {
2121
required_providers {
2222
google = {
2323
source = "hashicorp/google"
24-
version = ">= 4.80.0, < 5.0, !=4.65.0, !=4.65.1"
24+
version = ">= 4.81.0, < 5.0, !=4.65.0, !=4.65.1"
2525
}
2626
google-beta = {
2727
source = "hashicorp/google-beta"
28-
version = ">= 4.80.0, < 5.0, !=4.65.0, !=4.65.1"
28+
version = ">= 4.81.0, < 5.0, !=4.65.0, !=4.65.1"
2929
}
3030
kubernetes = {
3131
source = "hashicorp/kubernetes"

modules/beta-autopilot-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Then perform the following commands on the root folder:
8080
| dns\_cache | The status of the NodeLocal DNSCache addon. | `bool` | `true` | no |
8181
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
8282
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
83+
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
8384
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
8485
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
8586
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ resource "google_container_cluster" "primary" {
8181
vertical_pod_autoscaling {
8282
enabled = var.enable_vertical_pod_autoscaling
8383
}
84-
enable_autopilot = true
84+
enable_fqdn_network_policy = var.enable_fqdn_network_policy
85+
enable_autopilot = true
8586
dynamic "master_authorized_networks_config" {
8687
for_each = local.master_authorized_networks_config
8788
content {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,12 @@ variable "workload_config_audit_mode" {
356356
default = "DISABLED"
357357
}
358358

359+
variable "enable_fqdn_network_policy" {
360+
type = bool
361+
description = "Enable FQDN Network Policies on the cluster"
362+
default = null
363+
}
364+
359365
variable "disable_default_snat" {
360366
type = bool
361367
description = "Whether to disable the default SNAT to support the private use of public IP addresses"

0 commit comments

Comments
 (0)