From 615de6cecc8dd3148a43c6f040a6f78f708ece0b Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Tue, 19 Sep 2023 14:29:21 +0100 Subject: [PATCH] Upgrade redis server We have observed timeouts in the application log and some users are impacted. This upgrades production to Premium and high availibilty across availibity zones. Also pinned server version to 6 and increased replicas to 2. --- terraform/aks/config/production_aks.tfvars.json | 6 +++++- terraform/aks/databases.tf | 4 ++++ terraform/aks/variables.tf | 13 +++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/terraform/aks/config/production_aks.tfvars.json b/terraform/aks/config/production_aks.tfvars.json index 60d7cf48b..4ce4a1f40 100644 --- a/terraform/aks/config/production_aks.tfvars.json +++ b/terraform/aks/config/production_aks.tfvars.json @@ -6,5 +6,9 @@ "cluster": "production", "namespace": "git-production", "enable_monitoring": false, - "enable_statuscake_alerts": true + "enable_statuscake_alerts": true, + "replicas": 2, + "redis_capacity": 1, + "redis_family": "P", + "redis_sku_name": "Premium" } diff --git a/terraform/aks/databases.tf b/terraform/aks/databases.tf index 8553f3dd1..f10cbd162 100644 --- a/terraform/aks/databases.tf +++ b/terraform/aks/databases.tf @@ -14,6 +14,10 @@ module "redis-cache" { azure_enable_monitoring = var.enable_monitoring azure_patch_schedule = [{ "day_of_week" : "Sunday", "start_hour_utc" : 01 }] azure_maxmemory_policy = "allkeys-lfu" + server_version = 6 + azure_capacity = var.redis_capacity + azure_family = var.redis_family + azure_sku_name = var.redis_sku_name } module "postgres" { diff --git a/terraform/aks/variables.tf b/terraform/aks/variables.tf index 4b96720dc..6cc119a03 100644 --- a/terraform/aks/variables.tf +++ b/terraform/aks/variables.tf @@ -43,6 +43,19 @@ variable "azure_enable_backup_storage" { default = true } variable "replicas" { default = 1 } variable "memory_max" { default = "1Gi" } +variable "redis_capacity" { + type = number + default = 1 +} +variable "redis_family" { + type = string + default = "C" +} +variable "redis_sku_name" { + type = string + default = "Standard" +} + locals { azure_credentials = try(jsondecode(var.azure_credentials), null) app_resource_group_name = "${var.azure_resource_prefix}-${var.service_short}-${var.config_short}-rg"