Skip to content

Commit

Permalink
feat: Enable vertical autoscaling in GA modules (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
descampsk committed Dec 6, 2020
1 parent 753f9c7 commit 2e4f36a
Show file tree
Hide file tree
Showing 19 changed files with 83 additions and 50 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no |
Expand Down
8 changes: 4 additions & 4 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions autogen/main/variables.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ 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
enable_binary_authorization = var.enable_binary_authorization
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 {
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ 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
enable_binary_authorization = var.enable_binary_authorization
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 {
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ 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
enable_binary_authorization = var.enable_binary_authorization
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 {
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-public-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ 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
enable_binary_authorization = var.enable_binary_authorization
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 {
Expand Down
12 changes: 6 additions & 6 deletions modules/beta-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster-update-variant/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster-update-variant/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions modules/private-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)` | <pre>[<br> "8443",<br> "9443",<br> "15017"<br>]</pre> | no |
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gcloud\_upgrade | Whether to upgrade gcloud at runtime | `bool` | `false` | no |
Expand Down
4 changes: 4 additions & 0 deletions modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions modules/private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2e4f36a

Please sign in to comment.