Skip to content

Commit

Permalink
Merge pull request #1304 from DFE-Digital/670-git-api-upgrade-redis
Browse files Browse the repository at this point in the history
[670] Upgrade redis server
  • Loading branch information
saliceti authored Sep 19, 2023
2 parents 36569e5 + c96d463 commit 3073a57
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 5 additions & 1 deletion terraform/aks/config/production_aks.tfvars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 4 additions & 0 deletions terraform/aks/databases.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
13 changes: 13 additions & 0 deletions terraform/aks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 3073a57

Please sign in to comment.