infra/stacks/jsoncrack/main.tf
Viktor Barzin b00f810d3d Remove all CPU limits cluster-wide to eliminate CFS throttling
CPU limits cause CFS throttling even when nodes have idle capacity.
Move to a request-only CPU model: keep CPU requests for scheduling
fairness but remove all CPU limits. Memory limits stay (incompressible).

Changes across 108 files:
- Kyverno LimitRange policy: remove cpu from default/max in all 6 tiers
- Kyverno ResourceQuota policy: remove limits.cpu from all 5 tiers
- Custom ResourceQuotas: remove limits.cpu from 8 namespace quotas
- Custom LimitRanges: remove cpu from default/max (nextcloud, onlyoffice)
- RBAC module: remove cpu_limits variable and quota reference
- Freedify factory: remove cpu_limit variable and limits reference
- 86 deployment files: remove cpu from all limits blocks
- 6 Helm values files: remove cpu under limits sections
2026-03-14 08:51:45 +00:00

92 lines
2 KiB
HCL

variable "tls_secret_name" {
type = string
sensitive = true
}
resource "kubernetes_namespace" "jsoncrack" {
metadata {
name = "jsoncrack"
labels = {
"istio-injection" : "disabled"
tier = local.tiers.aux
}
}
}
module "tls_secret" {
source = "../../modules/kubernetes/setup_tls_secret"
namespace = kubernetes_namespace.jsoncrack.metadata[0].name
tls_secret_name = var.tls_secret_name
}
resource "kubernetes_deployment" "jsoncrack" {
metadata {
name = "jsoncrack"
namespace = kubernetes_namespace.jsoncrack.metadata[0].name
labels = {
app = "jsoncrack"
tier = local.tiers.aux
}
}
spec {
replicas = 1
selector {
match_labels = {
app = "jsoncrack"
}
}
template {
metadata {
labels = {
app = "jsoncrack"
}
}
spec {
container {
image = "viktorbarzin/jsoncrack:latest"
name = "jsoncrack"
port {
container_port = 8080
}
}
}
}
}
}
resource "kubernetes_service" "jsoncrack" {
metadata {
name = "json"
namespace = kubernetes_namespace.jsoncrack.metadata[0].name
labels = {
"app" = "jsoncrack"
}
}
spec {
selector = {
app = "jsoncrack"
}
port {
name = "http"
target_port = 8080
port = 80
protocol = "TCP"
}
}
}
module "ingress" {
source = "../../modules/kubernetes/ingress_factory"
namespace = kubernetes_namespace.jsoncrack.metadata[0].name
name = "json"
tls_secret_name = var.tls_secret_name
extra_annotations = {
"gethomepage.dev/enabled" = "true"
"gethomepage.dev/name" = "JSON Crack"
"gethomepage.dev/description" = "JSON visualizer"
"gethomepage.dev/icon" = "json.png"
"gethomepage.dev/group" = "Development & CI"
"gethomepage.dev/pod-selector" = ""
}
}