[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.
This commit is contained in:
parent
b0499a7f31
commit
c7c7047f1c
245 changed files with 11733 additions and 12432 deletions
|
|
@ -10,8 +10,115 @@ locals {
|
|||
}
|
||||
}
|
||||
|
||||
module "tor-proxy" {
|
||||
source = "./module"
|
||||
tls_secret_name = var.tls_secret_name
|
||||
tier = local.tiers.aux
|
||||
resource "kubernetes_namespace" "tor-proxy" {
|
||||
metadata {
|
||||
name = "tor-proxy"
|
||||
labels = {
|
||||
"istio-injection" : "disabled"
|
||||
tier = local.tiers.aux
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module "tls_secret" {
|
||||
source = "../../modules/kubernetes/setup_tls_secret"
|
||||
namespace = "tor-proxy"
|
||||
tls_secret_name = var.tls_secret_name
|
||||
}
|
||||
|
||||
# resource "kubernetes_config_map" "tor_config" {
|
||||
# metadata {
|
||||
# name = "tor-config"
|
||||
# namespace = "tor-proxy"
|
||||
# annotations = {
|
||||
# "reloader.stakater.com/match" = "true"
|
||||
# }
|
||||
# }
|
||||
|
||||
# data = {
|
||||
# "torrc" = file("${path.module}/.torrc")
|
||||
# }
|
||||
# }
|
||||
|
||||
resource "kubernetes_deployment" "tor-proxy" {
|
||||
metadata {
|
||||
name = "tor-proxy"
|
||||
namespace = "tor-proxy"
|
||||
labels = {
|
||||
app = "tor-proxy"
|
||||
tier = local.tiers.aux
|
||||
}
|
||||
annotations = {
|
||||
"reloader.stakater.com/search" = "true"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
replicas = 1
|
||||
strategy {
|
||||
type = "RollingUpdate"
|
||||
}
|
||||
selector {
|
||||
match_labels = {
|
||||
app = "tor-proxy"
|
||||
}
|
||||
}
|
||||
template {
|
||||
metadata {
|
||||
labels = {
|
||||
app = "tor-proxy"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
container {
|
||||
name = "tor-proxy"
|
||||
image = "dperson/torproxy:latest"
|
||||
port {
|
||||
name = "http"
|
||||
container_port = 8118
|
||||
protocol = "TCP"
|
||||
}
|
||||
port {
|
||||
name = "tor"
|
||||
container_port = 9050
|
||||
protocol = "TCP"
|
||||
}
|
||||
# volume_mount {
|
||||
# name = "tor-config"
|
||||
# mount_path = "/etc/tor/torrc"
|
||||
# sub_path = "torrc"
|
||||
# }
|
||||
}
|
||||
# volume {
|
||||
# name = "tor-config"
|
||||
# config_map {
|
||||
# name = kubernetes_config_map.tor_config.metadata[0].name
|
||||
# }
|
||||
# }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "kubernetes_service" "tor-proxy" {
|
||||
metadata {
|
||||
name = "tor-proxy"
|
||||
namespace = "tor-proxy"
|
||||
labels = {
|
||||
"app" = "tor-proxy"
|
||||
}
|
||||
}
|
||||
|
||||
spec {
|
||||
selector = {
|
||||
app = "tor-proxy"
|
||||
}
|
||||
port {
|
||||
name = "http"
|
||||
port = 8118
|
||||
}
|
||||
port {
|
||||
name = "tor"
|
||||
port = 9050
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,115 +0,0 @@
|
|||
variable "tls_secret_name" {}
|
||||
variable "tier" { type = string }
|
||||
|
||||
resource "kubernetes_namespace" "tor-proxy" {
|
||||
metadata {
|
||||
name = "tor-proxy"
|
||||
labels = {
|
||||
"istio-injection" : "disabled"
|
||||
tier = var.tier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module "tls_secret" {
|
||||
source = "../../../modules/kubernetes/setup_tls_secret"
|
||||
namespace = "tor-proxy"
|
||||
tls_secret_name = var.tls_secret_name
|
||||
}
|
||||
|
||||
# resource "kubernetes_config_map" "tor_config" {
|
||||
# metadata {
|
||||
# name = "tor-config"
|
||||
# namespace = "tor-proxy"
|
||||
# annotations = {
|
||||
# "reloader.stakater.com/match" = "true"
|
||||
# }
|
||||
# }
|
||||
|
||||
# data = {
|
||||
# "torrc" = file("${path.module}/.torrc")
|
||||
# }
|
||||
# }
|
||||
|
||||
resource "kubernetes_deployment" "tor-proxy" {
|
||||
metadata {
|
||||
name = "tor-proxy"
|
||||
namespace = "tor-proxy"
|
||||
labels = {
|
||||
app = "tor-proxy"
|
||||
tier = var.tier
|
||||
}
|
||||
annotations = {
|
||||
"reloader.stakater.com/search" = "true"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
replicas = 1
|
||||
strategy {
|
||||
type = "RollingUpdate"
|
||||
}
|
||||
selector {
|
||||
match_labels = {
|
||||
app = "tor-proxy"
|
||||
}
|
||||
}
|
||||
template {
|
||||
metadata {
|
||||
labels = {
|
||||
app = "tor-proxy"
|
||||
}
|
||||
}
|
||||
spec {
|
||||
container {
|
||||
name = "tor-proxy"
|
||||
image = "dperson/torproxy:latest"
|
||||
port {
|
||||
name = "http"
|
||||
container_port = 8118
|
||||
protocol = "TCP"
|
||||
}
|
||||
port {
|
||||
name = "tor"
|
||||
container_port = 9050
|
||||
protocol = "TCP"
|
||||
}
|
||||
# volume_mount {
|
||||
# name = "tor-config"
|
||||
# mount_path = "/etc/tor/torrc"
|
||||
# sub_path = "torrc"
|
||||
# }
|
||||
}
|
||||
# volume {
|
||||
# name = "tor-config"
|
||||
# config_map {
|
||||
# name = kubernetes_config_map.tor_config.metadata[0].name
|
||||
# }
|
||||
# }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "kubernetes_service" "tor-proxy" {
|
||||
metadata {
|
||||
name = "tor-proxy"
|
||||
namespace = "tor-proxy"
|
||||
labels = {
|
||||
"app" = "tor-proxy"
|
||||
}
|
||||
}
|
||||
|
||||
spec {
|
||||
selector = {
|
||||
app = "tor-proxy"
|
||||
}
|
||||
port {
|
||||
name = "http"
|
||||
port = 8118
|
||||
}
|
||||
port {
|
||||
name = "tor"
|
||||
port = 9050
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue