Skip to content

Commit

Permalink
feat(TPG>=6.14)!: promote enable_fqdn_network_policy to GA (#2225)
Browse files Browse the repository at this point in the history
Signed-off-by: drfaust92 <[email protected]>
  • Loading branch information
DrFaust92 authored Jan 3, 2025
1 parent 2d59991 commit 2c32408
Show file tree
Hide file tree
Showing 28 changed files with 57 additions and 35 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ Then perform the following commands on the root folder:
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
| 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 |
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | (Optional) Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
Expand Down Expand Up @@ -391,7 +392,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP][terraform-provider-google] v6.11+
- [Terraform Provider for GCP][terraform-provider-google] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions autogen/main/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
{% if beta_cluster %}
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
{% else %}
- [Terraform Provider for GCP][terraform-provider-google] v6.11+
- [Terraform Provider for GCP][terraform-provider-google] v6.14+
{% endif %}
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
Expand Down
2 changes: 0 additions & 2 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,7 @@ resource "google_container_cluster" "primary" {
}
}

{% if beta_cluster %}
enable_fqdn_network_policy = var.enable_fqdn_network_policy
{% endif %}
{% if autopilot_cluster %}
enable_autopilot = true
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,13 @@ variable "workload_config_audit_mode" {
type = string
default = "DISABLED"
}
{% endif %}

variable "enable_fqdn_network_policy" {
type = bool
description = "Enable FQDN Network Policies on the cluster"
default = null
}
{% endif %}

variable "enable_cilium_clusterwide_network_policy" {
type = bool
Expand Down
12 changes: 6 additions & 6 deletions autogen/main/versions.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
{% elif beta_cluster and autopilot_cluster %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
{% elif autopilot_cluster %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
{% else %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
{% endif %}
kubernetes = {
Expand Down
1 change: 1 addition & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ resource "google_container_cluster" "primary" {
}
}

enable_fqdn_network_policy = var.enable_fqdn_network_policy
dynamic "master_authorized_networks_config" {
for_each = var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []
content {
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-autopilot-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-autopilot-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-autopilot-public-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-private-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-public-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.11+
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
4 changes: 2 additions & 2 deletions modules/beta-public-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
3 changes: 2 additions & 1 deletion modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Then perform the following commands on the root folder:
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
| 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 |
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | (Optional) Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
Expand Down Expand Up @@ -425,7 +426,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP][terraform-provider-google] v6.11+
- [Terraform Provider for GCP][terraform-provider-google] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ resource "google_container_cluster" "primary" {
}
}

enable_fqdn_network_policy = var.enable_fqdn_network_policy
dynamic "master_authorized_networks_config" {
for_each = var.enable_private_endpoint || var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []
content {
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,12 @@ variable "enable_secret_manager_addon" {
default = false
}

variable "enable_fqdn_network_policy" {
type = bool
description = "Enable FQDN Network Policies on the cluster"
default = null
}

variable "enable_cilium_clusterwide_network_policy" {
type = bool
description = "Enable Cilium Cluster Wide Network Policies on the cluster"
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster-update-variant/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
3 changes: 2 additions & 1 deletion modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ Then perform the following commands on the root folder:
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
| 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 |
| enable\_default\_node\_pools\_metadata | Whether to enable the default node pools metadata key-value pairs such as `cluster_name` and `node_pool` | `bool` | `true` | no |
| enable\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
| enable\_gcfs | Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | (Optional) Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
Expand Down Expand Up @@ -403,7 +404,7 @@ The [project factory](https://github.com/terraform-google-modules/terraform-goog
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
- [Terraform Provider for GCP][terraform-provider-google] v6.11+
- [Terraform Provider for GCP][terraform-provider-google] v6.14+
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ resource "google_container_cluster" "primary" {
}
}

enable_fqdn_network_policy = var.enable_fqdn_network_policy
dynamic "master_authorized_networks_config" {
for_each = var.enable_private_endpoint || var.gcp_public_cidrs_access_enabled != null || length(var.master_authorized_networks) > 0 ? [true] : []
content {
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,12 @@ variable "enable_secret_manager_addon" {
default = false
}

variable "enable_fqdn_network_policy" {
type = bool
description = "Enable FQDN Network Policies on the cluster"
default = null
}

variable "enable_cilium_clusterwide_network_policy" {
type = bool
description = "Enable Cilium Cluster Wide Network Policies on the cluster"
Expand Down
2 changes: 1 addition & 1 deletion modules/private-cluster/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,12 @@ variable "enable_secret_manager_addon" {
default = false
}

variable "enable_fqdn_network_policy" {
type = bool
description = "Enable FQDN Network Policies on the cluster"
default = null
}

variable "enable_cilium_clusterwide_network_policy" {
type = bool
description = "Enable Cilium Cluster Wide Network Policies on the cluster"
Expand Down
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ terraform {
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.11.0, < 7"
version = ">= 6.14.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down

0 comments on commit 2c32408

Please sign in to comment.