Adjust down default service stunnel sidecar resources

Keep photoprism and lidarr, database heavy tools, at the same level
This commit is contained in:
IamTheFij 2023-08-07 11:31:35 -07:00
parent 02959c7673
commit 41c9d3d6f6
4 changed files with 29 additions and 3 deletions

View File

@ -85,6 +85,10 @@ module "photoprism_module" {
memory = 3000
memory_max = 4000
}
stunnel_resources = {
cpu = 100
memory = 100
}
sticky_disk = true
host_volumes = [
{
@ -99,7 +103,6 @@ module "photoprism_module" {
},
]
ingress = true
service_port = 2342
ingress_middlewares = [
@ -253,4 +256,9 @@ module "lidarr" {
cpu = 500
memory = 1500
}
stunnel_resources = {
cpu = 100
memory = 100
}
}

View File

@ -17,6 +17,7 @@ resource "nomad_job" "service" {
ports = var.ports
sticky_disk = var.sticky_disk
resources = var.resources
stunnel_resources = var.stunnel_resources
service_tags = var.service_tags
custom_services = var.custom_services

View File

@ -334,8 +334,9 @@ $$;
}
resources {
cpu = 100
memory = 100
cpu = ${stunnel_resources.cpu}
memory = ${stunnel_resources.memory}
%{ if stunnel_resources.memory_max != null }memory_max = ${stunnel_resources.memory_max}%{ endif }
}
template {

View File

@ -89,6 +89,22 @@ variable "resources" {
description = "Resources to be assigned to the main task"
}
variable "stunnel_resources" {
type = object({
cpu = number
memory = number
memory_max = optional(number)
})
default = {
cpu = 50
memory = 50
memory_max = null
}
description = "Resources to be assigned to the stunnel sidecar task"
}
variable "env" {
type = map(string)
default = {}