infra/stacks/freshrss/main.tf
Viktor Barzin c7c7047f1c [ci skip] Flatten module wrappers into stack roots
Remove the module "xxx" { source = "./module" } indirection layer
from all 66 service stacks. Resources are now defined directly in
each stack's main.tf instead of through a wrapper module.

- Merge module/main.tf contents into stack main.tf
- Apply variable replacements (var.tier -> local.tiers.X, renamed vars)
- Fix shared module paths (one fewer ../ at each level)
- Move extra files/dirs (factory/, chart_values, subdirs) to stack root
- Update state files to strip module.<name>. prefix
- Update CLAUDE.md to reflect flat structure

Verified: terragrunt plan shows 0 add, 0 destroy across all stacks.
2026-02-22 15:13:55 +00:00

131 lines
2.7 KiB
HCL

variable "tls_secret_name" { type = string }
locals {
tiers = {
core = "0-core"
cluster = "1-cluster"
gpu = "2-gpu"
edge = "3-edge"
aux = "4-aux"
}
}
module "tls_secret" {
source = "../../modules/kubernetes/setup_tls_secret"
namespace = "freshrss"
tls_secret_name = var.tls_secret_name
}
resource "kubernetes_namespace" "immich" {
metadata {
name = "freshrss"
labels = {
tier = local.tiers.aux
}
}
}
resource "kubernetes_deployment" "freshrss" {
metadata {
name = "freshrss"
namespace = "freshrss"
labels = {
app = "freshrss"
"kubernetes.io/cluster-service" = "true"
tier = local.tiers.aux
}
}
spec {
replicas = 1
strategy {
type = "Recreate"
}
selector {
match_labels = {
app = "freshrss"
}
}
template {
metadata {
labels = {
app = "freshrss"
"kubernetes.io/cluster-service" = "true"
}
}
spec {
container {
name = "freshrss"
image = "freshrss/freshrss"
env {
name = "CRON_MIN"
value = "0,30"
}
env {
name = "BASE_URL"
value = "https://rss.viktorbarzin.me"
}
env {
name = "PUBLISHED_PORT"
value = 80
}
volume_mount {
name = "data"
mount_path = "/var/www/FreshRSS/data"
}
volume_mount {
name = "extensions"
mount_path = "/var/www/FreshRSS/extensions"
}
port {
name = "http"
container_port = 80
protocol = "TCP"
}
}
volume {
name = "data"
nfs {
path = "/mnt/main/freshrss/data"
server = "10.0.10.15"
}
}
volume {
name = "extensions"
nfs {
path = "/mnt/main/freshrss/extensions"
server = "10.0.10.15"
}
}
}
}
}
}
resource "kubernetes_service" "freshrss" {
metadata {
name = "freshrss"
namespace = "freshrss"
labels = {
"app" = "freshrss"
}
}
spec {
selector = {
app = "freshrss"
}
port {
port = "80"
target_port = "80"
}
}
}
module "ingress" {
source = "../../modules/kubernetes/ingress_factory"
namespace = "freshrss"
name = "rss"
service_name = "freshrss"
tls_secret_name = var.tls_secret_name
}