Skip to content

feat(TPG>=6.47)!: add support for rbac_binding_config #2401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ Then perform the following commands on the root folder:
| parallelstore\_csi\_driver | Whether the Parallelstore CSI driver Addon is enabled for this cluster. | `bool` | `null` | no |
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
| ray\_operator\_config | The Ray Operator Addon configuration for this cluster. | <pre>object({<br> enabled = bool<br> logging_enabled = optional(bool, false)<br> monitoring_enabled = optional(bool, false)<br> })</pre> | <pre>{<br> "enabled": false,<br> "logging_enabled": false,<br> "monitoring_enabled": false<br>}</pre> | no |
| rbac\_binding\_config | RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. | <pre>object({<br> enable_insecure_binding_system_unauthenticated = optional(bool, null)<br> enable_insecure_binding_system_authenticated = optional(bool, null)<br> })</pre> | <pre>{<br> "enable_insecure_binding_system_authenticated": null,<br> "enable_insecure_binding_system_unauthenticated": null<br>}</pre> | no |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no |
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |
Expand Down
8 changes: 8 additions & 0 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "rbac_binding_config" {
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
content {
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
}
}

dynamic "secret_manager_config" {
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
content {
Expand Down
12 changes: 12 additions & 0 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1149,3 +1149,15 @@ variable "ip_endpoints_enabled" {
type = bool
default = null
}

variable "rbac_binding_config" {
type = object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
description = "RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created."
default = {
enable_insecure_binding_system_unauthenticated = null
enable_insecure_binding_system_authenticated = null
}
}
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.42.0, < 7"
version = ">= 6.47.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
{% elif beta_cluster and autopilot_cluster %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
{% elif autopilot_cluster %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
{% else %}
required_providers {
google = {
source = "hashicorp/google"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
{% endif %}
kubernetes = {
Expand Down
8 changes: 8 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "rbac_binding_config" {
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
content {
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
}
}

dynamic "secret_manager_config" {
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
content {
Expand Down
3 changes: 3 additions & 0 deletions metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,9 @@ spec:
ray_operator_config:
name: ray_operator_config
title: Ray Operator Config
rbac_binding_config:
name: rbac_binding_config
title: Rbac Binding Config
region:
name: region
title: Region
Expand Down
10 changes: 10 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,16 @@ spec:
- name: ip_endpoints_enabled
description: (Optional) Controls whether to allow direct IP access. Defaults to `true`.
varType: bool
- name: rbac_binding_config
description: RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created.
varType: |-
object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
defaultValue:
enable_insecure_binding_system_authenticated: null
enable_insecure_binding_system_unauthenticated: null
outputs:
- name: ca_certificate
description: Cluster ca certificate (base64 encoded)
Expand Down
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 @@ -147,6 +147,7 @@ Then perform the following commands on the root folder:
| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no |
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
| ray\_operator\_config | The Ray Operator Addon configuration for this cluster. | <pre>object({<br> enabled = bool<br> logging_enabled = optional(bool, false)<br> monitoring_enabled = optional(bool, false)<br> })</pre> | <pre>{<br> "enabled": false,<br> "logging_enabled": false,<br> "monitoring_enabled": false<br>}</pre> | no |
| rbac\_binding\_config | RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. | <pre>object({<br> enable_insecure_binding_system_unauthenticated = optional(bool, null)<br> enable_insecure_binding_system_authenticated = optional(bool, null)<br> })</pre> | <pre>{<br> "enable_insecure_binding_system_authenticated": null,<br> "enable_insecure_binding_system_unauthenticated": null<br>}</pre> | no |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no |
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "rbac_binding_config" {
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
content {
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
}
}

dynamic "secret_manager_config" {
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ spec:
ray_operator_config:
name: ray_operator_config
title: Ray Operator Config
rbac_binding_config:
name: rbac_binding_config
title: Rbac Binding Config
region:
name: region
title: Region
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-autopilot-private-cluster/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,16 @@ spec:
- name: ip_endpoints_enabled
description: (Optional) Controls whether to allow direct IP access. Defaults to `true`.
varType: bool
- name: rbac_binding_config
description: RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created.
varType: |-
object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
defaultValue:
enable_insecure_binding_system_authenticated: null
enable_insecure_binding_system_unauthenticated: null
outputs:
- name: ca_certificate
description: Cluster ca certificate (base64 encoded)
Expand Down
12 changes: 12 additions & 0 deletions modules/beta-autopilot-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -662,3 +662,15 @@ variable "ip_endpoints_enabled" {
type = bool
default = null
}

variable "rbac_binding_config" {
type = object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
description = "RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created."
default = {
enable_insecure_binding_system_unauthenticated = null
enable_insecure_binding_system_authenticated = null
}
}
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.42.0, < 7"
version = ">= 6.47.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
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 @@ -135,6 +135,7 @@ Then perform the following commands on the root folder:
| notification\_filter\_event\_type | Choose what type of notifications you want to receive. If no filters are applied, you'll receive all notification types. Can be used to filter what notifications are sent. Accepted values are UPGRADE\_AVAILABLE\_EVENT, UPGRADE\_EVENT, and SECURITY\_BULLETIN\_EVENT. | `list(string)` | `[]` | no |
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
| ray\_operator\_config | The Ray Operator Addon configuration for this cluster. | <pre>object({<br> enabled = bool<br> logging_enabled = optional(bool, false)<br> monitoring_enabled = optional(bool, false)<br> })</pre> | <pre>{<br> "enabled": false,<br> "logging_enabled": false,<br> "monitoring_enabled": false<br>}</pre> | no |
| rbac\_binding\_config | RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. | <pre>object({<br> enable_insecure_binding_system_unauthenticated = optional(bool, null)<br> enable_insecure_binding_system_authenticated = optional(bool, null)<br> })</pre> | <pre>{<br> "enable_insecure_binding_system_authenticated": null,<br> "enable_insecure_binding_system_unauthenticated": null<br>}</pre> | no |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no |
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "rbac_binding_config" {
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
content {
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
}
}

dynamic "secret_manager_config" {
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
content {
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-autopilot-public-cluster/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@ spec:
ray_operator_config:
name: ray_operator_config
title: Ray Operator Config
rbac_binding_config:
name: rbac_binding_config
title: Rbac Binding Config
region:
name: region
title: Region
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-autopilot-public-cluster/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,16 @@ spec:
- name: ip_endpoints_enabled
description: (Optional) Controls whether to allow direct IP access. Defaults to `true`.
varType: bool
- name: rbac_binding_config
description: RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created.
varType: |-
object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
defaultValue:
enable_insecure_binding_system_authenticated: null
enable_insecure_binding_system_unauthenticated: null
outputs:
- name: ca_certificate
description: Cluster ca certificate (base64 encoded)
Expand Down
12 changes: 12 additions & 0 deletions modules/beta-autopilot-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,15 @@ variable "ip_endpoints_enabled" {
type = bool
default = null
}

variable "rbac_binding_config" {
type = object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
description = "RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created."
default = {
enable_insecure_binding_system_unauthenticated = null
enable_insecure_binding_system_authenticated = null
}
}
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.42.0, < 7"
version = ">= 6.47.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
1 change: 1 addition & 0 deletions modules/beta-private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ Then perform the following commands on the root folder:
| private\_endpoint\_subnetwork | The subnetwork to use for the hosted master network. | `string` | `null` | no |
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
| ray\_operator\_config | The Ray Operator Addon configuration for this cluster. | <pre>object({<br> enabled = bool<br> logging_enabled = optional(bool, false)<br> monitoring_enabled = optional(bool, false)<br> })</pre> | <pre>{<br> "enabled": false,<br> "logging_enabled": false,<br> "monitoring_enabled": false<br>}</pre> | no |
| rbac\_binding\_config | RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created. | <pre>object({<br> enable_insecure_binding_system_unauthenticated = optional(bool, null)<br> enable_insecure_binding_system_authenticated = optional(bool, null)<br> })</pre> | <pre>{<br> "enable_insecure_binding_system_authenticated": null,<br> "enable_insecure_binding_system_unauthenticated": null<br>}</pre> | no |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no |
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |
Expand Down
8 changes: 8 additions & 0 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ resource "google_container_cluster" "primary" {
}
}

dynamic "rbac_binding_config" {
for_each = var.rbac_binding_config.enable_insecure_binding_system_unauthenticated != null || var.rbac_binding_config.enable_insecure_binding_system_authenticated != null ? [var.rbac_binding_config] : []
content {
enable_insecure_binding_system_unauthenticated = rbac_binding_config.value["enable_insecure_binding_system_unauthenticated"]
enable_insecure_binding_system_authenticated = rbac_binding_config.value["enable_insecure_binding_system_authenticated"]
}
}

dynamic "secret_manager_config" {
for_each = var.enable_secret_manager_addon ? [var.enable_secret_manager_addon] : []
content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,9 @@ spec:
ray_operator_config:
name: ray_operator_config
title: Ray Operator Config
rbac_binding_config:
name: rbac_binding_config
title: Rbac Binding Config
region:
name: region
title: Region
Expand Down
10 changes: 10 additions & 0 deletions modules/beta-private-cluster-update-variant/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,16 @@ spec:
- name: ip_endpoints_enabled
description: (Optional) Controls whether to allow direct IP access. Defaults to `true`.
varType: bool
- name: rbac_binding_config
description: RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created.
varType: |-
object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
defaultValue:
enable_insecure_binding_system_authenticated: null
enable_insecure_binding_system_unauthenticated: null
outputs:
- name: ca_certificate
description: Cluster ca certificate (base64 encoded)
Expand Down
12 changes: 12 additions & 0 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1075,3 +1075,15 @@ variable "ip_endpoints_enabled" {
type = bool
default = null
}

variable "rbac_binding_config" {
type = object({
enable_insecure_binding_system_unauthenticated = optional(bool, null)
enable_insecure_binding_system_authenticated = optional(bool, null)
})
description = "RBACBindingConfig allows user to restrict ClusterRoleBindings an RoleBindings that can be created."
default = {
enable_insecure_binding_system_unauthenticated = null
enable_insecure_binding_system_authenticated = null
}
}
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.42.0, < 7"
version = ">= 6.47.0, < 7"
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 6.42.0, < 7"
version = ">= 6.47.0, < 7"
}
kubernetes = {
source = "hashicorp/kubernetes"
Expand Down
Loading