Skip to content

Commit 65d7454

Browse files
committed
add support for additional_pod_ranges_config
Signed-off-by: drfaust92 <[email protected]>
1 parent 090781d commit 65d7454

Some content is hidden

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

47 files changed

+229
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Then perform the following commands on the root folder:
144144
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
145145
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
146146
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
147+
| additional\_pod\_ranges\_config | the configuration for individual additional subnetworks attached to the cluster | `list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))` | `[]` | no |
147148
| additive\_vpc\_scope\_dns\_domain | This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work cluster\_dns = `CLOUD_DNS` and cluster\_dns\_scope = `CLUSTER_SCOPE` must both be set as well. | `string` | `""` | no |
148149
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
149150
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,13 @@ resource "google_container_cluster" "primary" {
523523
pod_range_names = var.additional_ip_range_pods
524524
}
525525
}
526+
dynamic "additional_pod_ranges_config" {
527+
for_each = var.additional_pod_ranges_config
528+
content {
529+
subnetwork = var.additional_pod_ranges_config.subnetwork
530+
pod_ipv4_range_names = var.additional_pod_ranges_config.pod_ipv4_range_names
531+
}
532+
}
526533
stack_type = var.stack_type
527534
}
528535

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ variable "additional_ip_range_pods" {
174174
default = []
175175
}
176176

177+
variable "additional_pod_ranges_config" {
178+
type = list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))
179+
description = "the configuration for individual additional subnetworks attached to the cluster"
180+
default = []
181+
}
182+
177183
variable "ip_range_services" {
178184
type = string
179185
description = "The _name_ of the secondary subnet range to use for services. If not provided, the default `34.118.224.0/20` range will be used."

cluster.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,13 @@ resource "google_container_cluster" "primary" {
393393
pod_range_names = var.additional_ip_range_pods
394394
}
395395
}
396+
dynamic "additional_pod_ranges_config" {
397+
for_each = var.additional_pod_ranges_config
398+
content {
399+
subnetwork = var.additional_pod_ranges_config.subnetwork
400+
pod_ipv4_range_names = var.additional_pod_ranges_config.pod_ipv4_range_names
401+
}
402+
}
396403
stack_type = var.stack_type
397404
}
398405

metadata.display.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ spec:
3939
additional_ip_range_pods:
4040
name: additional_ip_range_pods
4141
title: Additional Ip Range Pods
42+
additional_pod_ranges_config:
43+
name: additional_pod_ranges_config
44+
title: Additional Pod Ranges Config
4245
additive_vpc_scope_dns_domain:
4346
name: additive_vpc_scope_dns_domain
4447
title: Additive Vpc Scope Dns Domain
@@ -360,6 +363,9 @@ spec:
360363
ray_operator_config:
361364
name: ray_operator_config
362365
title: Ray Operator Config
366+
rbac_binding_config:
367+
name: rbac_binding_config
368+
title: Rbac Binding Config
363369
region:
364370
name: region
365371
title: Region

metadata.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ spec:
259259
description: List of _names_ of the additional secondary subnet ip ranges to use for pods
260260
varType: list(string)
261261
defaultValue: []
262+
- name: additional_pod_ranges_config
263+
description: the configuration for individual additional subnetworks attached to the cluster
264+
varType: list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))
265+
defaultValue: []
262266
- name: ip_range_services
263267
description: The _name_ of the secondary subnet range to use for services. If not provided, the default `34.118.224.0/20` range will be used.
264268
varType: string

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Then perform the following commands on the root folder:
7777
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
7878
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
7979
| additional\_ip\_range\_pods | List of _names_ of the additional secondary subnet ip ranges to use for pods | `list(string)` | `[]` | no |
80+
| additional\_pod\_ranges\_config | the configuration for individual additional subnetworks attached to the cluster | `list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))` | `[]` | no |
8081
| allow\_net\_admin | (Optional) Enable NET\_ADMIN for the cluster. | `bool` | `null` | no |
8182
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected] | `string` | `null` | no |
8283
| boot\_disk\_kms\_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool, if not overridden in `node_pools`. This should be of the form projects/[KEY\_PROJECT\_ID]/locations/[LOCATION]/keyRings/[RING\_NAME]/cryptoKeys/[KEY\_NAME]. For more information about protecting resources with Cloud KMS Keys please see: https://cloud.google.com/compute/docs/disks/customer-managed-encryption | `string` | `null` | no |

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,13 @@ resource "google_container_cluster" "primary" {
304304
pod_range_names = var.additional_ip_range_pods
305305
}
306306
}
307+
dynamic "additional_pod_ranges_config" {
308+
for_each = var.additional_pod_ranges_config
309+
content {
310+
subnetwork = var.additional_pod_ranges_config.subnetwork
311+
pod_ipv4_range_names = var.additional_pod_ranges_config.pod_ipv4_range_names
312+
}
313+
}
307314
stack_type = var.stack_type
308315
}
309316

modules/beta-autopilot-private-cluster/metadata.display.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ spec:
4040
additional_ip_range_pods:
4141
name: additional_ip_range_pods
4242
title: Additional Ip Range Pods
43+
additional_pod_ranges_config:
44+
name: additional_pod_ranges_config
45+
title: Additional Pod Ranges Config
4346
allow_net_admin:
4447
name: allow_net_admin
4548
title: Allow Net Admin
@@ -265,6 +268,9 @@ spec:
265268
ray_operator_config:
266269
name: ray_operator_config
267270
title: Ray Operator Config
271+
rbac_binding_config:
272+
name: rbac_binding_config
273+
title: Rbac Binding Config
268274
region:
269275
name: region
270276
title: Region

modules/beta-autopilot-private-cluster/metadata.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,10 @@ spec:
218218
description: List of _names_ of the additional secondary subnet ip ranges to use for pods
219219
varType: list(string)
220220
defaultValue: []
221+
- name: additional_pod_ranges_config
222+
description: the configuration for individual additional subnetworks attached to the cluster
223+
varType: list(object({ subnetwork = string, pod_ipv4_range_names = list(string) }))
224+
defaultValue: []
221225
- name: ip_range_services
222226
description: The _name_ of the secondary subnet range to use for services. If not provided, the default `34.118.224.0/20` range will be used.
223227
varType: string

0 commit comments

Comments
 (0)