Skip to content
8 changes: 5 additions & 3 deletions airflow/helm/values.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ affinity:
values: ["on-demand"]
- key: "karpenter.k8s.aws/instance-family"
operator: "In"
values: ["c6i", "c5"]
values: ["r5"]
- key: "karpenter.k8s.aws/instance-cpu"
operator: "In"
values: ["2", "4"]
values: ["8"]

topologySpreadConstraints:
- maxSkew: 1
Expand Down Expand Up @@ -248,7 +248,9 @@ workers:
keda:
enabled: true
pollingInterval: 1
minReplicaCount: 1
# Minimum node available for celery workers
# Set to 1 to always have a worker node available to run tasks
minReplicaCount: 0
maxReplicaCount: 128
# Specify HPA related options
# https://github.com/kubernetes/enhancements/blob/master/keps/sig-autoscaling/853-configurable-hpa-scale-velocity/README.md
Expand Down
1 change: 1 addition & 0 deletions terraform-unity/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module "unity-sps-database" {
venue = var.venue
service_area = var.service_area
release = var.release
db_instance_class = var.db_instance_class
}

module "unity-sps-efs" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ resource "aws_db_instance" "sps_db" {
storage_type = "gp3"
engine = "postgres"
engine_version = "16.8"
instance_class = "db.m5d.2xlarge"
instance_class = var.db_instance_class
db_name = "sps_db"
username = "db_user"
password = aws_secretsmanager_secret_version.db.secret_string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ variable "release" {
description = "The software release version."
type = string
}

variable "db_instance_class" {
description = "The SPS RDS database instance class"
type = string
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@ resource "kubernetes_deployment" "redis" {
}
}
spec {
affinity {
node_affinity {
required_during_scheduling_ignored_during_execution {
node_selector_term {
match_expressions {
key = "karpenter.sh/nodepool"
operator = "In"
values = compact([for pool in var.karpenter_node_pools : pool if pool == "airflow-core-components"])
}
match_expressions {
key = "karpenter.sh/capacity-type"
operator = "In"
values = ["on-demand"]
}
match_expressions {
key = "karpenter.k8s.aws/instance-family"
operator = "In"
values = ["r5"]
}
match_expressions {
key = "karpenter.k8s.aws/instance-cpu"
operator = "In"
values = ["8"]
}
}
}
}
}
container {
name = "redis"
image = "${var.docker_images.redis.name}:${var.docker_images.redis.tag}"
Expand Down Expand Up @@ -83,12 +111,12 @@ resource "kubernetes_deployment" "ogc_processes_api" {
match_expressions {
key = "karpenter.k8s.aws/instance-family"
operator = "In"
values = ["c6i", "c5"]
values = ["r5"]
}
match_expressions {
key = "karpenter.k8s.aws/instance-cpu"
operator = "In"
values = ["4"]
values = ["8"]
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion terraform-unity/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ variable "karpenter_node_pools" {
memory = "320Gi"
}
disruption = {
consolidationPolicy = "WhenEmpty"
consolidationPolicy = "WhenEmptyOrUnderutilized"
consolidateAfter = "1m"
}
},
Expand Down Expand Up @@ -367,3 +367,9 @@ variable "installprefix" {
type = string
default = ""
}

variable "db_instance_class" {
description = "The SPS RDS database instance class"
type = string
default = "db.m5d.xlarge"
}