From 615de6cecc8dd3148a43c6f040a6f78f708ece0b Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Tue, 19 Sep 2023 14:29:21 +0100 Subject: [PATCH 1/2] 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" From c96d4633af7e11ec656799acbf236f10adbb3803 Mon Sep 17 00:00:00 2001 From: Colin Saliceti Date: Tue, 19 Sep 2023 15:19:43 +0100 Subject: [PATCH 2/2] Remove default IMAGE_TAG It points to a non existent commit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b1be4d439..7d7c91580 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ terraform-init: bin/terrafile set-azure-account -backend-config=storage_account_name=${AZURE_RESOURCE_PREFIX}${SERVICE_SHORT}tfstate${CONFIG_SHORT}sa \ -backend-config=key=${CONFIG}.tfstate - $(if $(IMAGE_TAG), , $(eval export IMAGE_TAG=sha-194cbc9)) + $(if $(IMAGE_TAG), , $(error The IMAGE_TAG variable must be provided)) $(eval export TF_VAR_paas_app_docker_image=ghcr.io/dfe-digital/get-into-teaching-api:$(IMAGE_TAG)) $(eval export TF_VAR_azure_resource_prefix=$(AZURE_RESOURCE_PREFIX)) $(eval export TF_VAR_config_short=$(CONFIG_SHORT))