Add OTP resource limits and scale up

OTP was crash-looping with Java OOM at the default 256Mi LimitRange.
Added explicit resource limits (1Gi request, 2Gi limit) and -Xmx1536m
JVM flag. Scaled replicas from 0 back to 1.
This commit is contained in:
Viktor Barzin 2026-03-13 22:33:27 +00:00
parent c8d15adc16
commit 1fefffeebc

View file

@ -1,5 +1,5 @@
variable "tls_secret_name" {
type = string
type = string
sensitive = true
}
variable "nfs_server" { type = string }
@ -204,7 +204,7 @@ resource "kubernetes_deployment" "otp" {
}
}
spec {
replicas = 0 # Scaled down: TfL GTFS data expired, OTP crash-loops on build
replicas = 1
strategy {
type = "Recreate"
}
@ -233,6 +233,20 @@ resource "kubernetes_deployment" "otp" {
name = "otp-data"
mount_path = "/var/opentripplanner"
}
env {
name = "JAVA_TOOL_OPTIONS"
value = "-Xmx1536m"
}
resources {
requests = {
cpu = "100m"
memory = "1Gi"
}
limits = {
cpu = "2"
memory = "2Gi"
}
}
}
volume {
name = "otp-data"