Skip to content

Commit

Permalink
feat(autopilot): configure gcfs
Browse files Browse the repository at this point in the history
  • Loading branch information
apeabody committed Aug 20, 2024
1 parent b1fb1b3 commit 1e90363
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 22 deletions.
24 changes: 13 additions & 11 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@ resource "google_container_cluster" "primary" {

dynamic "ray_operator_config" {
for_each = local.ray_operator_config

content {

enabled = ray_operator_config.value.enabled

ray_cluster_logging_config {
Expand Down Expand Up @@ -480,6 +480,11 @@ resource "google_container_cluster" "primary" {
ignore_changes = [node_pool, initial_node_count, resource_labels["asmv"]]
}
{% endif %}
{% if autopilot_cluster == true %}
lifecycle {
ignore_changes = [node_pool_defaults[0].node_config_defaults[0].gcfs_config[0].enabled]
}
{% endif %}

{% if autopilot_cluster != true %}
dynamic "dns_config" {
Expand Down Expand Up @@ -660,21 +665,18 @@ resource "google_container_cluster" "primary" {
}
}
}
{% if beta_cluster and autopilot_cluster != true %}
{% if beta_cluster %}

node_pool_defaults {
node_config_defaults {
{% if autopilot_cluster %}
logging_variant = var.logging_variant
{% endif %}
{% if autopilot_cluster != true %}
gcfs_config {
enabled = var.enable_gcfs
}
}
}
{% endif %}
{% if beta_cluster and autopilot_cluster %}

node_pool_defaults {
node_config_defaults {
logging_variant = var.logging_variant
{% endif %}
}
}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -818,13 +818,13 @@ variable "ray_operator_config" {
type = object({
enabled = bool
logging_enabled = optional(bool, false)
monitoring_enabled = optional(bool, false)
monitoring_enabled = optional(bool, false)
})
description = "The Ray Operator Addon configuration for this cluster."
default = {
enabled = false
logging_enabled = false
monitoring_enabled = false
monitoring_enabled = false
}
}

Expand Down Expand Up @@ -944,7 +944,7 @@ variable "sandbox_enabled" {

variable "enable_gcfs" {
type = bool
description = "Enable image streaming on cluster level."
description = "(Beta) Enable image streaming on cluster level."
default = false
}
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-autopilot-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ resource "google_container_cluster" "primary" {
}
}

lifecycle {
ignore_changes = [node_pool_defaults[0].node_config_defaults[0].gcfs_config[0].enabled]
}

timeouts {
create = lookup(var.timeouts, "create", "45m")
Expand Down
3 changes: 3 additions & 0 deletions modules/beta-autopilot-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ resource "google_container_cluster" "primary" {
}
}

lifecycle {
ignore_changes = [node_pool_defaults[0].node_config_defaults[0].gcfs_config[0].enabled]
}

timeouts {
create = lookup(var.timeouts, "create", "45m")
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 @@ -203,7 +203,7 @@ Then perform the following commands on the root folder:
| 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\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | 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 |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ variable "sandbox_enabled" {

variable "enable_gcfs" {
type = bool
description = "Enable image streaming on cluster level."
description = "(Beta) Enable image streaming on cluster level."
default = false
}

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 @@ -181,7 +181,7 @@ Then perform the following commands on the root folder:
| 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\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | 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 |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ variable "sandbox_enabled" {

variable "enable_gcfs" {
type = bool
description = "Enable image streaming on cluster level."
description = "(Beta) Enable image streaming on cluster level."
default = false
}

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 @@ -196,7 +196,7 @@ Then perform the following commands on the root folder:
| 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\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | 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 |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ variable "sandbox_enabled" {

variable "enable_gcfs" {
type = bool
description = "Enable image streaming on cluster level."
description = "(Beta) Enable image streaming on cluster level."
default = false
}

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 @@ -174,7 +174,7 @@ Then perform the following commands on the root folder:
| 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\_gcfs | (Beta) Enable image streaming on cluster level. | `bool` | `false` | no |
| enable\_identity\_service | 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 |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
Expand Down
2 changes: 1 addition & 1 deletion modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ variable "sandbox_enabled" {

variable "enable_gcfs" {
type = bool
description = "Enable image streaming on cluster level."
description = "(Beta) Enable image streaming on cluster level."
default = false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestSimpleAutopilotPublic(t *testing.T) {
"addonsConfig.rayOperatorConfig.enabled",
"addonsConfig.rayOperatorConfig.rayClusterLoggingConfig.enabled",
"addonsConfig.rayOperatorConfig.rayClusterMonitoringConfig.enabled",
"nodePoolDefaults.nodeConfigDefaults.gcfsConfig.enabled",
}
for _, pth := range validateJSONPaths {
g.JSONEq(assert, op, pth)
Expand Down

0 comments on commit 1e90363

Please sign in to comment.