Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Merge pull request #84 from BlueMedoraPublic/master
Browse files Browse the repository at this point in the history
Add vertical pod autoscaling option
  • Loading branch information
yorinasub17 authored Mar 25, 2020
2 parents 0fba18c + edf8ea2 commit 41c827b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/gke-private-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ module "gke_cluster" {
]

cluster_secondary_range_name = module.vpc_network.public_subnetwork_secondary_range_name

enable_vertical_pod_autoscaling = var.enable_vertical_pod_autoscaling
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions examples/gke-private-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,9 @@ variable "vpc_secondary_cidr_block" {
type = string
default = "10.4.0.0/16"
}

variable "enable_vertical_pod_autoscaling" {
description = "Enable vertical pod autoscaling"
type = string
default = true
}
2 changes: 2 additions & 0 deletions examples/gke-public-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ module "gke_cluster" {
cluster_secondary_range_name = module.vpc_network.public_subnetwork_secondary_range_name

alternative_default_service_account = var.override_default_node_pool_service_account ? module.gke_service_account.email : null

enable_vertical_pod_autoscaling = var.enable_vertical_pod_autoscaling
}

# ---------------------------------------------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions examples/gke-public-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ variable "vpc_secondary_cidr_block" {
default = "10.7.0.0/16"
}

variable "enable_vertical_pod_autoscaling" {
description = "Enable vertical pod autoscaling"
type = string
default = true
}

# ---------------------------------------------------------------------------------------------------------------------
# TEST PARAMETERS
# These parameters are only used during testing and should not be touched.
Expand Down
4 changes: 4 additions & 0 deletions modules/gke-cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ resource "google_container_cluster" "cluster" {
provider = "CALICO"
}

vertical_pod_autoscaling {
enabled = var.enable_vertical_pod_autoscaling
}

master_auth {
username = var.basic_auth_username
password = var.basic_auth_password
Expand Down
8 changes: 7 additions & 1 deletion modules/gke-cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ variable "master_authorized_networks_config" {
display_name = "example_network"
}],
}]
EOF
type = list(any)
default = []
Expand Down Expand Up @@ -197,3 +196,10 @@ variable "secrets_encryption_kms_key" {
type = string
default = null
}

# See https://cloud.google.com/kubernetes-engine/docs/concepts/verticalpodautoscaler
variable "enable_vertical_pod_autoscaling" {
description = "Whether to enable Vertical Pod Autoscaling"
type = string
default = false
}

0 comments on commit 41c827b

Please sign in to comment.