diff --git a/README.md b/README.md index 0c3996c810..9f82f4f7c8 100644 --- a/README.md +++ b/README.md @@ -371,6 +371,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | diff --git a/autogen/main/README.md b/autogen/main/README.md index 6490c6fc81..9c5f57e00e 100644 --- a/autogen/main/README.md +++ b/autogen/main/README.md @@ -252,6 +252,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | {% if not private_cluster %} | enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional | diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index b921e8e7f4..10d5f00e90 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -805,6 +805,8 @@ locals { "local_ssd_ephemeral_count", {% endif %} "placement_policy", + "policy_name", + "tpu_topology", "max_pods_per_node", "min_cpu_platform", "pod_range", @@ -932,7 +934,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/cluster.tf b/cluster.tf index f5b2c1130b..0f24fc383f 100644 --- a/cluster.tf +++ b/cluster.tf @@ -649,7 +649,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1001,7 +1003,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/modules/beta-private-cluster-update-variant/README.md b/modules/beta-private-cluster-update-variant/README.md index 11b38b7fb4..299bba8a22 100644 --- a/modules/beta-private-cluster-update-variant/README.md +++ b/modules/beta-private-cluster-update-variant/README.md @@ -425,6 +425,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required | diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index 2aff940796..8113b7b3c4 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -689,6 +689,8 @@ locals { "local_ssd_count", "local_ssd_ephemeral_count", "placement_policy", + "policy_name", + "tpu_topology", "max_pods_per_node", "min_cpu_platform", "pod_range", @@ -797,7 +799,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1163,7 +1167,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/modules/beta-private-cluster/README.md b/modules/beta-private-cluster/README.md index 22a7d35409..f501c9934c 100644 --- a/modules/beta-private-cluster/README.md +++ b/modules/beta-private-cluster/README.md @@ -403,6 +403,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required | diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index eeb130cf3c..03b4026d5f 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -717,7 +717,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1082,7 +1084,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/modules/beta-public-cluster-update-variant/README.md b/modules/beta-public-cluster-update-variant/README.md index a11fe9c053..c5891295e9 100644 --- a/modules/beta-public-cluster-update-variant/README.md +++ b/modules/beta-public-cluster-update-variant/README.md @@ -411,6 +411,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index ce43c3dad5..d95b119272 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -667,6 +667,8 @@ locals { "local_ssd_count", "local_ssd_ephemeral_count", "placement_policy", + "policy_name", + "tpu_topology", "max_pods_per_node", "min_cpu_platform", "pod_range", @@ -775,7 +777,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1141,7 +1145,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/modules/beta-public-cluster/README.md b/modules/beta-public-cluster/README.md index 35388d6e74..d35749d4c2 100644 --- a/modules/beta-public-cluster/README.md +++ b/modules/beta-public-cluster/README.md @@ -389,6 +389,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | enable_private_nodes | Whether nodes have internal IP addresses only. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index 4a5da0b760..8576072e06 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -695,7 +695,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1060,7 +1062,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index ed483e56d1..772efc3870 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -407,6 +407,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 520853469c..51b66a21a2 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -642,6 +642,8 @@ locals { "enable_integrity_monitoring", "local_ssd_count", "placement_policy", + "policy_name", + "tpu_topology", "max_pods_per_node", "min_cpu_platform", "pod_range", @@ -750,7 +752,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1103,7 +1107,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index 863ebbf486..46b6b327a3 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -385,6 +385,8 @@ The node_pools variable takes the following parameters: | total_min_count | Total minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true. Cannot be used with per zone limits. | null | Optional | | name | The name of the node pool | | Required | | placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | | Optional | +| policy_name | If set, refers to the name of a custom resource policy supplied by the user. The resource policy must be in the same project and region as the node pool. | | Optional | +| tpu_topology | TPU placement topology for pod slice node pool. For detail see [documentation](https://cloud.google.com/tpu/docs/types-topologies#tpu_topologies) | | Optional | | pod_range | The name of the secondary range for pod IPs. | | Optional | | node_affinity | The node affinty in the format `"{\"key\": \"compute.googleapis.com/node-group-name\", \"operator\": \"IN\", \"values\": [\"node-group-name\"]}"`. | | Optional | | node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters | | Required | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index 8f5066778d..bd1d934737 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -671,7 +671,9 @@ resource "google_container_node_pool" "pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } } @@ -1023,7 +1025,9 @@ resource "google_container_node_pool" "windows_pools" { dynamic "placement_policy" { for_each = length(lookup(each.value, "placement_policy", "")) > 0 ? [each.value] : [] content { - type = lookup(placement_policy.value, "placement_policy", null) + type = lookup(placement_policy.value, "placement_policy", null) + policy_name = lookup(placement_policy.value, "policy_name", null) + tpu_topology = lookup(placement_policy.value, "tpu_topology", null) } }