[ci skip] Move Terraform modules into stack directories
Move all 88 service modules (66 individual + 22 platform) from modules/kubernetes/<service>/ into their corresponding stack directories: - Service stacks: stacks/<service>/module/ - Platform stack: stacks/platform/modules/<service>/ This collocates module source code with its Terragrunt definition. Only shared utility modules remain in modules/kubernetes/: ingress_factory, setup_tls_secret, dockerhub_secret, oauth-proxy. All cross-references to shared modules updated to use correct relative paths. Verified with terragrunt run --all -- plan: 0 adds, 0 destroys across all 68 stacks.
This commit is contained in:
parent
73cb696f12
commit
e225e81ebf
614 changed files with 12075 additions and 352 deletions
115
stacks/tor-proxy/module/main.tf
Normal file
115
stacks/tor-proxy/module/main.tf
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
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