diff --git a/README.md b/README.md index 4b92c609e..a007d7838 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ Then perform the following commands on the root folder: | enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no | | enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no | | enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no | +| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no | | firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers | `list(string)` |
[
"8443",
"9443",
"15017"
]
| no | | firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no | | gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no | diff --git a/autogen/main/cluster.tf.tmpl b/autogen/main/cluster.tf.tmpl index 3ce9086c2..1597d2b80 100644 --- a/autogen/main/cluster.tf.tmpl +++ b/autogen/main/cluster.tf.tmpl @@ -90,6 +90,10 @@ resource "google_container_cluster" "primary" { } } } + + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } default_max_pods_per_node = var.default_max_pods_per_node @@ -99,10 +103,6 @@ resource "google_container_cluster" "primary" { enable_intranode_visibility = var.enable_intranode_visibility enable_kubernetes_alpha = var.enable_kubernetes_alpha - vertical_pod_autoscaling { - enabled = var.enable_vertical_pod_autoscaling - } - dynamic "pod_security_policy_config" { for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : [] content { diff --git a/autogen/main/variables.tf.tmpl b/autogen/main/variables.tf.tmpl index 8d1267a29..3d0cae6d2 100644 --- a/autogen/main/variables.tf.tmpl +++ b/autogen/main/variables.tf.tmpl @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" @@ -485,12 +491,6 @@ variable "enable_intranode_visibility" { default = false } -variable "enable_vertical_pod_autoscaling" { - type = bool - description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" - default = false -} - variable "authenticator_security_group" { type = string description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com" diff --git a/cluster.tf b/cluster.tf index 2d4cb9a1a..09850eff0 100644 --- a/cluster.tf +++ b/cluster.tf @@ -68,6 +68,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes diff --git a/modules/beta-private-cluster-update-variant/cluster.tf b/modules/beta-private-cluster-update-variant/cluster.tf index 2debd9aac..29919705c 100644 --- a/modules/beta-private-cluster-update-variant/cluster.tf +++ b/modules/beta-private-cluster-update-variant/cluster.tf @@ -78,6 +78,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes @@ -85,10 +89,6 @@ resource "google_container_cluster" "primary" { enable_intranode_visibility = var.enable_intranode_visibility enable_kubernetes_alpha = var.enable_kubernetes_alpha - vertical_pod_autoscaling { - enabled = var.enable_vertical_pod_autoscaling - } - dynamic "pod_security_policy_config" { for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : [] content { diff --git a/modules/beta-private-cluster-update-variant/variables.tf b/modules/beta-private-cluster-update-variant/variables.tf index 09efb45c8..d59938b58 100644 --- a/modules/beta-private-cluster-update-variant/variables.tf +++ b/modules/beta-private-cluster-update-variant/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" @@ -470,12 +476,6 @@ variable "enable_intranode_visibility" { default = false } -variable "enable_vertical_pod_autoscaling" { - type = bool - description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" - default = false -} - variable "authenticator_security_group" { type = string description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com" diff --git a/modules/beta-private-cluster/cluster.tf b/modules/beta-private-cluster/cluster.tf index 5eef665af..6403d5dc4 100644 --- a/modules/beta-private-cluster/cluster.tf +++ b/modules/beta-private-cluster/cluster.tf @@ -78,6 +78,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes @@ -85,10 +89,6 @@ resource "google_container_cluster" "primary" { enable_intranode_visibility = var.enable_intranode_visibility enable_kubernetes_alpha = var.enable_kubernetes_alpha - vertical_pod_autoscaling { - enabled = var.enable_vertical_pod_autoscaling - } - dynamic "pod_security_policy_config" { for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : [] content { diff --git a/modules/beta-private-cluster/variables.tf b/modules/beta-private-cluster/variables.tf index 09efb45c8..d59938b58 100644 --- a/modules/beta-private-cluster/variables.tf +++ b/modules/beta-private-cluster/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" @@ -470,12 +476,6 @@ variable "enable_intranode_visibility" { default = false } -variable "enable_vertical_pod_autoscaling" { - type = bool - description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" - default = false -} - variable "authenticator_security_group" { type = string description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com" diff --git a/modules/beta-public-cluster-update-variant/cluster.tf b/modules/beta-public-cluster-update-variant/cluster.tf index 38661039e..1279b2b6b 100644 --- a/modules/beta-public-cluster-update-variant/cluster.tf +++ b/modules/beta-public-cluster-update-variant/cluster.tf @@ -78,6 +78,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes @@ -85,10 +89,6 @@ resource "google_container_cluster" "primary" { enable_intranode_visibility = var.enable_intranode_visibility enable_kubernetes_alpha = var.enable_kubernetes_alpha - vertical_pod_autoscaling { - enabled = var.enable_vertical_pod_autoscaling - } - dynamic "pod_security_policy_config" { for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : [] content { diff --git a/modules/beta-public-cluster-update-variant/variables.tf b/modules/beta-public-cluster-update-variant/variables.tf index 9f23b5a2b..39c55ac4c 100644 --- a/modules/beta-public-cluster-update-variant/variables.tf +++ b/modules/beta-public-cluster-update-variant/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" @@ -439,12 +445,6 @@ variable "enable_intranode_visibility" { default = false } -variable "enable_vertical_pod_autoscaling" { - type = bool - description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" - default = false -} - variable "authenticator_security_group" { type = string description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com" diff --git a/modules/beta-public-cluster/cluster.tf b/modules/beta-public-cluster/cluster.tf index b79fabb90..0c60df924 100644 --- a/modules/beta-public-cluster/cluster.tf +++ b/modules/beta-public-cluster/cluster.tf @@ -78,6 +78,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes @@ -85,10 +89,6 @@ resource "google_container_cluster" "primary" { enable_intranode_visibility = var.enable_intranode_visibility enable_kubernetes_alpha = var.enable_kubernetes_alpha - vertical_pod_autoscaling { - enabled = var.enable_vertical_pod_autoscaling - } - dynamic "pod_security_policy_config" { for_each = var.enable_pod_security_policy ? [var.enable_pod_security_policy] : [] content { diff --git a/modules/beta-public-cluster/variables.tf b/modules/beta-public-cluster/variables.tf index 9f23b5a2b..39c55ac4c 100644 --- a/modules/beta-public-cluster/variables.tf +++ b/modules/beta-public-cluster/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" @@ -439,12 +445,6 @@ variable "enable_intranode_visibility" { default = false } -variable "enable_vertical_pod_autoscaling" { - type = bool - description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" - default = false -} - variable "authenticator_security_group" { type = string description = "The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com" diff --git a/modules/private-cluster-update-variant/README.md b/modules/private-cluster-update-variant/README.md index 31b7a815a..d020228d0 100644 --- a/modules/private-cluster-update-variant/README.md +++ b/modules/private-cluster-update-variant/README.md @@ -160,6 +160,7 @@ Then perform the following commands on the root folder: | enable\_private\_nodes | (Beta) Whether nodes have internal IP addresses only | `bool` | `false` | no | | enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no | | enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no | +| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no | | firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers | `list(string)` |
[
"8443",
"9443",
"15017"
]
| no | | firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no | | gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no | diff --git a/modules/private-cluster-update-variant/cluster.tf b/modules/private-cluster-update-variant/cluster.tf index 2a4a5e047..cecbf97cf 100644 --- a/modules/private-cluster-update-variant/cluster.tf +++ b/modules/private-cluster-update-variant/cluster.tf @@ -68,6 +68,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes diff --git a/modules/private-cluster-update-variant/variables.tf b/modules/private-cluster-update-variant/variables.tf index bd696139c..99b8d74df 100644 --- a/modules/private-cluster-update-variant/variables.tf +++ b/modules/private-cluster-update-variant/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" diff --git a/modules/private-cluster/README.md b/modules/private-cluster/README.md index 9f5096e58..b2256327c 100644 --- a/modules/private-cluster/README.md +++ b/modules/private-cluster/README.md @@ -138,6 +138,7 @@ Then perform the following commands on the root folder: | enable\_private\_nodes | (Beta) Whether nodes have internal IP addresses only | `bool` | `false` | no | | enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no | | enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no | +| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no | | firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers | `list(string)` |
[
"8443",
"9443",
"15017"
]
| no | | firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no | | gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no | diff --git a/modules/private-cluster/cluster.tf b/modules/private-cluster/cluster.tf index c2ecba747..ee8c7a931 100644 --- a/modules/private-cluster/cluster.tf +++ b/modules/private-cluster/cluster.tf @@ -68,6 +68,10 @@ resource "google_container_cluster" "primary" { } } + vertical_pod_autoscaling { + enabled = var.enable_vertical_pod_autoscaling + } + default_max_pods_per_node = var.default_max_pods_per_node enable_shielded_nodes = var.enable_shielded_nodes diff --git a/modules/private-cluster/variables.tf b/modules/private-cluster/variables.tf index bd696139c..99b8d74df 100644 --- a/modules/private-cluster/variables.tf +++ b/modules/private-cluster/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon" diff --git a/variables.tf b/variables.tf index 4b2bb122b..8aaaafbb3 100644 --- a/variables.tf +++ b/variables.tf @@ -78,6 +78,12 @@ variable "master_authorized_networks" { default = [] } +variable "enable_vertical_pod_autoscaling" { + type = bool + description = "Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it" + default = false +} + variable "horizontal_pod_autoscaling" { type = bool description = "Enable horizontal pod autoscaling addon"