Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aks autoscaling configured #43

Merged
merged 4 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/core/aks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ module "aks" {
kubernetes_version = var.kubernetes_version
log_analytics_workspace_id = azurerm_log_analytics_workspace.log_analytics_workspace.id

vm_size = var.aks_vm_size
node_count = var.aks_node_count
sku_tier = var.aks_sku_tier
max_pods = var.aks_max_pods
vm_size = var.aks_vm_size
enable_auto_scaling = var.aks_enable_auto_scaling
node_count = var.aks_node_count
min_count = var.min_count
max_count = var.max_count
max_pods = var.aks_max_pods
upgrade_settings_max_surge = var.upgrade_settings_max_surge
sku_tier = var.aks_sku_tier

private_cluster_enabled = true

Expand Down
7 changes: 5 additions & 2 deletions src/core/env/dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ app_gateway_api_certificate_name = "api-dev-selfcare-pagopa-it"
# aks
aks_alerts_enabled = false
# This is the k8s ingress controller ip. It must be in the aks subnet range.
reverse_proxy_ip = "10.1.0.250"
aks_max_pods = 100
reverse_proxy_ip = "10.1.0.250"
aks_max_pods = 100
aks_enable_auto_scaling = false
min_count = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it's disabled

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it ok for you @pasqualedevita ?

max_count = null

# CosmosDb MongoDb
cosmosdb_mongodb_enable_serverless = true
Expand Down
8 changes: 6 additions & 2 deletions src/core/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ app_gateway_max_capacity = 2
# This is the k8s ingress controller ip. It must be in the aks subnet range.
reverse_proxy_ip = "10.1.0.250"
# aks_availability_zones = [1, 2, 3] # TODO to define and uncomment before release to prod
aks_node_count = 1 # TODO to define before release to prod
aks_max_pods = 100
aks_node_count = 1 # TODO to define before release to prod
aks_max_pods = 100
aks_enable_auto_scaling = true
min_count = 1 # TODO to define before release to prod
max_count = 1 # TODO to define before release to prod
upgrade_settings_max_surge = "33%"
# aks_vm_size = "Standard_D8S_v3" # TODO to define and uncomment before release to prod
# aks_sku_tier = "Paid" # TODO to define and uncomment before release to prod

Expand Down
7 changes: 5 additions & 2 deletions src/core/env/uat/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ app_gateway_api_certificate_name = "api-uat-selfcare-pagopa-it"
# aks
aks_alerts_enabled = false
# This is the k8s ingress controller ip. It must be in the aks subnet range.
reverse_proxy_ip = "10.1.0.250"
aks_max_pods = 100
reverse_proxy_ip = "10.1.0.250"
aks_max_pods = 100
aks_enable_auto_scaling = false
min_count = null
max_count = null

# CosmosDb MongoDb
cosmosdb_mongodb_enable_serverless = true
Expand Down
24 changes: 24 additions & 0 deletions src/core/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,30 @@ variable "aks_max_pods" {
default = 100
}

variable "aks_enable_auto_scaling" {
type = bool
description = "Should the Kubernetes Auto Scaler be enabled for this Node Pool? "
default = false
}

variable "min_count" {
type = number
description = "The minimum number of nodes which should exist in this Node Pool. If specified this must be between 1 and 1000"
default = null
}

variable "max_count" {
type = number
description = "The maximum number of nodes which should exist in this Node Pool. If specified this must be between 1 and 1000"
default = null
}

variable "upgrade_settings_max_surge" {
type = string
description = "The maximum number or percentage of nodes which will be added to the Node Pool size during an upgrade."
default = "33%"
}

variable "kubernetes_version" {
type = string
default = "1.21.2"
Expand Down