Skip to content

Commit c5a3518

Browse files
committed
add gateway api to autogen
1 parent 81bfa3f commit c5a3518

File tree

37 files changed

+160
-14
lines changed

37 files changed

+160
-14
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ Then perform the following commands on the root folder:
213213
| ca\_certificate | Cluster ca certificate (base64 encoded) |
214214
| cluster\_id | Cluster ID |
215215
| endpoint | Cluster endpoint |
216-
| gateway\_api\_channel | The gateway api channel of this cluster |
217216
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
218217
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
219218
| identity\_namespace | Workload Identity pool |

autogen/main/cluster.tf.tmpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ resource "google_container_cluster" "primary" {
5353
channel = release_channel.value.channel
5454
}
5555
}
56+
57+
dynamic "gateway_api_config" {
58+
for_each = local.gateway_api_channel
59+
60+
content {
61+
channel = gateway_api_channel.value
62+
}
63+
}
64+
5665
dynamic "cost_management_config" {
5766
for_each = var.enable_cost_allocation ? [1] : []
5867
content {

autogen/main/main.tf.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ locals {
5757
{% endif %}
5858

5959
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
60+
gateway_api_channel = var.gateway_api_channel
6061

6162
{% if autopilot_cluster != true %}
6263
autoscaling_resource_limits = var.cluster_autoscaling.enabled ? concat([{

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,12 @@ variable "release_channel" {
444444
default = null
445445
}
446446

447+
variable "gateway_api_channel" {
448+
type = string
449+
description = "The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. Defaults to `CHANNEL_DISABLED`."
450+
default = "CHANNEL_DISABLED"
451+
}
452+
447453
variable "add_cluster_firewall_rules" {
448454
type = bool
449455
description = "Create additional firewall rules"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Then perform the following commands on the root folder:
9292
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
9393
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
9494
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
95+
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. Defaults to `CHANNEL_DISABLED`. | `string` | `"CHANNEL_DISABLED"` | no |
9596
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
9697
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
9798
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ resource "google_container_cluster" "primary" {
3939
channel = release_channel.value.channel
4040
}
4141
}
42+
43+
dynamic "gateway_api_config" {
44+
for_each = local.gateway_api_channel
45+
46+
content {
47+
channel = gateway_api_channel.value
48+
}
49+
}
50+
4251
dynamic "cost_management_config" {
4352
for_each = var.enable_cost_allocation ? [1] : []
4453
content {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ locals {
4545
master_version_zonal = var.kubernetes_version != "latest" ? var.kubernetes_version : data.google_container_engine_versions.zone.latest_master_version
4646
master_version = var.regional ? local.master_version_regional : local.master_version_zonal
4747

48-
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
48+
release_channel = var.release_channel != null ? [{ channel : var.release_channel }] : []
49+
gateway_api_channel = var.gateway_api_channel
4950

5051

5152

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ variable "release_channel" {
323323
default = null
324324
}
325325

326+
variable "gateway_api_channel" {
327+
type = string
328+
description = "The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. Defaults to `CHANNEL_DISABLED`."
329+
default = "CHANNEL_DISABLED"
330+
}
331+
326332
variable "add_cluster_firewall_rules" {
327333
type = bool
328334
description = "Create additional firewall rules"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Then perform the following commands on the root folder:
8383
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
8484
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
8585
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
86+
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. Defaults to `CHANNEL_DISABLED`. | `string` | `"CHANNEL_DISABLED"` | no |
8687
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
8788
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
8889
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ resource "google_container_cluster" "primary" {
3939
channel = release_channel.value.channel
4040
}
4141
}
42+
43+
dynamic "gateway_api_config" {
44+
for_each = local.gateway_api_channel
45+
46+
content {
47+
channel = gateway_api_channel.value
48+
}
49+
}
50+
4251
dynamic "cost_management_config" {
4352
for_each = var.enable_cost_allocation ? [1] : []
4453
content {

0 commit comments

Comments
 (0)