2025-06-05 23:27:50 +02:00
|
|
|
locals {
|
|
|
|
|
|
|
|
|
|
# storage
|
|
|
|
|
persistent_folder = "/srv"
|
|
|
|
|
|
2025-06-07 16:12:55 +02:00
|
|
|
lab_domain = "lab.alexpires.me"
|
|
|
|
|
open_webui_fqdn = "open-webui.${local.lab_domain}"
|
2025-06-05 23:27:50 +02:00
|
|
|
internal_issuer = "internal-ca"
|
2025-06-06 23:49:38 +02:00
|
|
|
|
|
|
|
|
# samba
|
|
|
|
|
samba_shared_folder = "/mnt/usb"
|
2025-06-07 16:12:55 +02:00
|
|
|
|
|
|
|
|
# DNS
|
|
|
|
|
dns_nameservers = [
|
|
|
|
|
"193.110.81.0",
|
|
|
|
|
"185.253.5.0"
|
|
|
|
|
]
|
|
|
|
|
|
2025-06-09 23:49:43 +02:00
|
|
|
override_hosts = [
|
|
|
|
|
{
|
|
|
|
|
name = "cloud.alexpires.me"
|
|
|
|
|
ip = "10.19.4.136"
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
2025-06-07 16:12:55 +02:00
|
|
|
zones = [
|
|
|
|
|
{
|
|
|
|
|
fqdn = "${local.lab_domain}"
|
|
|
|
|
records = [
|
2025-06-07 20:39:38 +02:00
|
|
|
{
|
|
|
|
|
name = "vh-01"
|
|
|
|
|
type = "A"
|
|
|
|
|
content = "10.19.4.109"
|
|
|
|
|
},
|
2025-06-07 16:12:55 +02:00
|
|
|
{
|
|
|
|
|
name = "gpu-01"
|
|
|
|
|
type = "A"
|
|
|
|
|
content = "10.19.4.106"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "dev-01"
|
|
|
|
|
type = "A"
|
|
|
|
|
content = "10.19.4.136"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "ollama"
|
|
|
|
|
type = "CNAME"
|
2025-06-22 18:43:55 +02:00
|
|
|
content = "dev-01.${local.lab_domain}."
|
2025-06-07 16:12:55 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "kokoro"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "gpu-01.${local.lab_domain}."
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "open-webui"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "dev-01.${local.lab_domain}."
|
|
|
|
|
},
|
2025-06-08 21:18:53 +02:00
|
|
|
{
|
|
|
|
|
name = "comfyui-backend"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "gpu-01.${local.lab_domain}."
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "comfyui"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "dev-01.${local.lab_domain}."
|
|
|
|
|
},
|
2025-06-07 16:12:55 +02:00
|
|
|
{
|
|
|
|
|
name = "smb"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "dev-01.${local.lab_domain}."
|
|
|
|
|
},
|
2025-10-02 00:19:01 +02:00
|
|
|
{
|
|
|
|
|
name = "grafana"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "dev-01.${local.lab_domain}."
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name = "prometheus"
|
|
|
|
|
type = "CNAME"
|
|
|
|
|
content = "dev-01.${local.lab_domain}."
|
|
|
|
|
},
|
2025-07-05 21:36:47 +02:00
|
|
|
{
|
|
|
|
|
name = "game-01"
|
|
|
|
|
type = "A"
|
|
|
|
|
content = "10.19.4.245"
|
|
|
|
|
},
|
2025-10-02 00:19:01 +02:00
|
|
|
{
|
|
|
|
|
name = "prod-01"
|
|
|
|
|
type = "A"
|
|
|
|
|
content = "10.5.5.2"
|
|
|
|
|
},
|
2025-10-05 23:18:44 +02:00
|
|
|
{
|
|
|
|
|
name = "hpz440"
|
|
|
|
|
type = "A"
|
|
|
|
|
content = "10.19.4.121"
|
|
|
|
|
},
|
2025-06-07 16:12:55 +02:00
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2025-06-08 21:18:53 +02:00
|
|
|
|
2025-10-02 00:19:01 +02:00
|
|
|
proxy_services = {
|
2025-06-08 21:18:53 +02:00
|
|
|
"comfyui" = {
|
|
|
|
|
http_port = 8080
|
|
|
|
|
https_port = 8443
|
|
|
|
|
tls = true
|
|
|
|
|
fqdn = ["comfyui.lab.alexpires.me"]
|
2025-07-06 22:56:13 +02:00
|
|
|
upstream = "http://upstream.comfyui.svc.cluster.local:8188"
|
2025-07-06 23:09:45 +02:00
|
|
|
resolver = "kube-dns.kube-system.svc.cluster.local"
|
2025-06-08 21:18:53 +02:00
|
|
|
|
|
|
|
|
locations = [
|
|
|
|
|
{
|
|
|
|
|
path = "/"
|
|
|
|
|
"Upgrade" = "$http_upgrade"
|
|
|
|
|
"Connection" = "upgrade"
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-16 23:19:25 +02:00
|
|
|
streams = {
|
|
|
|
|
"dns" = {
|
2025-10-02 00:19:01 +02:00
|
|
|
port = 53
|
|
|
|
|
host_port = 53
|
|
|
|
|
upstream = "dns.dns.svc.cluster.local"
|
|
|
|
|
protocol = "udp"
|
2025-06-16 23:19:25 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-22 18:43:55 +02:00
|
|
|
ollama_proxy = {
|
2025-10-02 00:19:01 +02:00
|
|
|
enabled = true
|
2025-07-05 21:36:47 +02:00
|
|
|
mac = "04:7c:16:d6:63:66"
|
2025-06-22 18:43:55 +02:00
|
|
|
ip = "10.19.4.106"
|
|
|
|
|
port = "11434"
|
|
|
|
|
scheme = "http"
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-06 22:56:13 +02:00
|
|
|
comfyui_proxy = {
|
2025-10-02 00:19:01 +02:00
|
|
|
mac = "04:7c:16:d6:63:66"
|
|
|
|
|
ip = "10.19.4.106"
|
|
|
|
|
port = "8188"
|
|
|
|
|
scheme = "http"
|
2025-07-06 22:56:13 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-09 23:49:43 +02:00
|
|
|
scaleway_smtp_host = "smtp.tem.scw.cloud"
|
|
|
|
|
|
|
|
|
|
nextcloud_fqdn = "cloud.alexpires.me"
|
|
|
|
|
nextcloud_db_passwd = var.nextcloud_db_passwd
|
|
|
|
|
nextcloud_db_root_password = var.nextcloud_db_root_password
|
|
|
|
|
nextcloud_db_path = "${local.persistent_folder}/mysql/nextcloud"
|
|
|
|
|
backup_folder = "/mnt/usb/backups/nextcloud"
|
|
|
|
|
nextcloud_config = {
|
|
|
|
|
mail_from = "cloud"
|
|
|
|
|
mail_domain = "alexpires.me"
|
|
|
|
|
smtp_user = var.scaleway_project_id
|
|
|
|
|
smtp_password = local.mail_app_api_secret_key
|
|
|
|
|
smtp_host = local.scaleway_smtp_host
|
|
|
|
|
admin_password = var.nextcloud_admin_password
|
|
|
|
|
db_host = module.nextcloud_db.host
|
|
|
|
|
db_name = module.nextcloud_db.db_name
|
|
|
|
|
db_user = module.nextcloud_db.app_crendentials_name
|
|
|
|
|
db_password = module.nextcloud_db.app_crendentials_name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
backup_retention_days = 3
|
|
|
|
|
backup_cron_schedule = "0 2 * * *" # Daily at 2 AM
|
|
|
|
|
|
|
|
|
|
backup_bucket_name = data.terraform_remote_state.scaleway.outputs.backup_bucket_name
|
|
|
|
|
backup_app_api_secret_key = data.terraform_remote_state.scaleway.outputs.backup_app_api_secret_key
|
|
|
|
|
backup_app_api_access_key = data.terraform_remote_state.scaleway.outputs.backup_app_api_access_key
|
|
|
|
|
mail_app_api_secret_key = data.terraform_remote_state.scaleway.outputs.mail_app_api_secret_key
|
2025-10-02 00:19:01 +02:00
|
|
|
|
2025-10-04 18:05:10 +02:00
|
|
|
# prometheus and grafana
|
|
|
|
|
prometheus_config = file("${path.module}/resources/prometheus.yml")
|
|
|
|
|
prometheus_rules = file("${path.module}/resources/prometheus-rules.yml")
|
|
|
|
|
alertmanager_config = file("${path.module}/resources/alertmanager.yml")
|
|
|
|
|
alertmanager_email_config = {
|
|
|
|
|
to = "c.alexandre.pires@alexpires.me"
|
|
|
|
|
from = "alertmanager@${local.lab_domain}"
|
|
|
|
|
smarthost = "smtp.tem.scw.cloud:587"
|
|
|
|
|
auth_username = var.scaleway_project_id
|
|
|
|
|
auth_password = local.mail_app_api_secret_key
|
2025-10-02 00:19:01 +02:00
|
|
|
}
|
2025-10-04 18:05:10 +02:00
|
|
|
|
2025-10-06 18:41:01 +02:00
|
|
|
smartctl_static_version = "8.0-198-g34e7e4975211"
|
|
|
|
|
smartctl_sha256 = "d7e779664248942bb519b254dcb49cddaec2593e192cc468254c58e64da20840"
|
|
|
|
|
|
2025-10-04 18:05:10 +02:00
|
|
|
telegram_chat_id = "5432313610" # a13labs channel
|
|
|
|
|
telegram_message = file("${path.module}/resources/telegram.tpl")
|
|
|
|
|
|
|
|
|
|
grafana_fqdn = "grafana.${local.lab_domain}"
|
2025-06-09 23:49:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data "terraform_remote_state" "scaleway" {
|
|
|
|
|
backend = "s3"
|
|
|
|
|
config = {
|
|
|
|
|
bucket = "a13labs.infra.eu"
|
|
|
|
|
key = "scaleway.core.infra.tfstate"
|
|
|
|
|
region = "eu-west-1"
|
|
|
|
|
}
|
2025-06-05 23:27:50 +02:00
|
|
|
}
|