Skip to content

Commit

Permalink
feat: Add enable_l4_ilb_subsetting for autopilot clusters (#1969)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Peabody <andrewpeabody@google.com>
  • Loading branch information
kliu47 and apeabody committed Jun 20, 2024
1 parent e7b20cd commit c48dc6e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ resource "google_container_cluster" "primary" {
}
}
{% endif %}
{% endif %}

enable_l4_ilb_subsetting = var.enable_l4_ilb_subsetting
{% endif %}
{% if beta_cluster %}
enable_fqdn_network_policy = var.enable_fqdn_network_policy
{% 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 @@ -810,12 +810,12 @@ variable "config_connector" {
default = false
}

{% endif %}
variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
default = false
}
{% endif %}
{% if beta_cluster %}
{% if autopilot_cluster != true %}

Expand Down
1 change: 1 addition & 0 deletions examples/simple_autopilot_public/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ module "gke" {
enable_vertical_pod_autoscaling = true
network_tags = [local.cluster_type]
deletion_protection = false
enable_l4_ilb_subsetting = true
}
1 change: 1 addition & 0 deletions modules/beta-autopilot-private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,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\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
| 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 |
| enable\_private\_endpoint | Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
| enable\_private\_nodes | Whether nodes have internal IP addresses only | `bool` | `false` | no |
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ resource "google_container_cluster" "primary" {
vertical_pod_autoscaling {
enabled = var.enable_vertical_pod_autoscaling
}

enable_l4_ilb_subsetting = var.enable_l4_ilb_subsetting
enable_fqdn_network_policy = var.enable_fqdn_network_policy
enable_autopilot = true
dynamic "master_authorized_networks_config" {
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,11 @@ variable "timeouts" {
}
}

variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
default = false
}
variable "allow_net_admin" {
description = "(Optional) Enable NET_ADMIN for the cluster."
type = bool
Expand Down
1 change: 1 addition & 0 deletions modules/beta-autopilot-public-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,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\_fqdn\_network\_policy | Enable FQDN Network Policies on the cluster | `bool` | `null` | no |
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
| 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 |
| 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 |
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
Expand Down
2 changes: 2 additions & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ resource "google_container_cluster" "primary" {
vertical_pod_autoscaling {
enabled = var.enable_vertical_pod_autoscaling
}

enable_l4_ilb_subsetting = var.enable_l4_ilb_subsetting
enable_fqdn_network_policy = var.enable_fqdn_network_policy
enable_autopilot = true
dynamic "master_authorized_networks_config" {
Expand Down
5 changes: 5 additions & 0 deletions modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ variable "timeouts" {
}
}

variable "enable_l4_ilb_subsetting" {
type = bool
description = "Enable L4 ILB Subsetting on the cluster"
default = false
}
variable "allow_net_admin" {
description = "(Optional) Enable NET_ADMIN for the cluster."
type = bool
Expand Down

0 comments on commit c48dc6e

Please sign in to comment.