2026-02-22 14:38:14 +00:00
|
|
|
|
|
|
|
|
variable "tls_secret_name" {}
|
|
|
|
|
variable "tier" { type = string }
|
|
|
|
|
variable "headscale_config" {}
|
|
|
|
|
variable "headscale_acl" {}
|
[ci skip] Infrastructure hardening: security, monitoring, reliability, maintainability
Phase 1 - Critical Security:
- Netbox: move hardcoded DB/superuser passwords to variables
- MeshCentral: disable public registration, add Authentik auth
- Traefik: disable insecure API dashboard (api.insecure=false)
- Traefik: configure forwarded headers with Cloudflare trusted IPs
Phase 2 - Security Hardening:
- Add security headers middleware (HSTS, X-Frame-Options, nosniff, etc.)
- Add Kyverno pod security policies in audit mode (privileged, host
namespaces, SYS_ADMIN, trusted registries)
- Tighten rate limiting (avg=10, burst=50)
- Add Authentik protection to grampsweb
Phase 3 - Monitoring & Alerting:
- Add critical service alerts (PostgreSQL, MySQL, Redis, Headscale,
Authentik, Loki)
- Increase Loki retention from 7 to 30 days (720h)
- Add predictive PV filling alert (predict_linear)
- Re-enable Hackmd and Privatebin down alerts
Phase 4 - Reliability:
- Add resource requests/limits to Redis, DBaaS, Technitium, Headscale,
Vaultwarden, Uptime Kuma
- Increase Alloy DaemonSet memory to 512Mi/1Gi
Phase 6 - Maintainability:
- Extract duplicated tiers locals to terragrunt.hcl generate block
(removed from 67 stacks)
- Replace hardcoded NFS IP 10.0.10.15 with var.nfs_server (114
instances across 63 files)
- Replace hardcoded Redis/PostgreSQL/MySQL/Ollama/mail host references
with variables across ~35 stacks
- Migrate xray raw ingress resources to ingress_factory modules
2026-02-23 22:05:28 +00:00
|
|
|
variable "nfs_server" { type = string }
|
2026-03-07 17:42:05 +00:00
|
|
|
variable "homepage_token" {
|
|
|
|
|
type = string
|
|
|
|
|
default = ""
|
|
|
|
|
sensitive = true
|
|
|
|
|
}
|
2026-02-22 14:38:14 +00:00
|
|
|
|
|
|
|
|
resource "kubernetes_namespace" "headscale" {
|
|
|
|
|
metadata {
|
|
|
|
|
name = "headscale"
|
|
|
|
|
labels = {
|
|
|
|
|
tier = var.tier
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module "tls_secret" {
|
|
|
|
|
source = "../../../../modules/kubernetes/setup_tls_secret"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
tls_secret_name = var.tls_secret_name
|
|
|
|
|
}
|
|
|
|
|
|
[ci skip] complete NFS CSI migration: complex stacks + platform modules
Migrate remaining multi-volume stacks and all platform modules from
inline NFS volumes to CSI-backed PV/PVC with nfs-truenas StorageClass
(soft,timeo=30,retrans=3 mount options).
Complex stacks: openclaw (4 vols), immich (8 vols), frigate (2 vols),
nextcloud (2 vols + old PV replaced), rybbit (1 vol)
Remaining stacks: affine, ebook2audiobook, f1-stream, osm_routing,
real-estate-crawler
Platform modules: monitoring (prometheus, loki, alertmanager PVs
converted from native NFS to CSI), redis, dbaas, technitium,
headscale, vaultwarden, uptime-kuma, mailserver, infra-maintenance
2026-03-02 01:24:07 +00:00
|
|
|
module "nfs_data" {
|
|
|
|
|
source = "../../../../modules/kubernetes/nfs_volume"
|
|
|
|
|
name = "headscale-data"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
nfs_server = var.nfs_server
|
|
|
|
|
nfs_path = "/mnt/main/headscale"
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-22 14:38:14 +00:00
|
|
|
resource "kubernetes_deployment" "headscale" {
|
|
|
|
|
metadata {
|
|
|
|
|
name = "headscale"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
labels = {
|
|
|
|
|
app = "headscale"
|
|
|
|
|
tier = var.tier
|
|
|
|
|
# scare to try but probably non-http will fail
|
|
|
|
|
# "istio-injection" : "enabled"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
annotations = {
|
|
|
|
|
"reloader.stakater.com/search" = "true"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
spec {
|
|
|
|
|
replicas = 1
|
|
|
|
|
strategy {
|
|
|
|
|
type = "Recreate"
|
|
|
|
|
}
|
|
|
|
|
selector {
|
|
|
|
|
match_labels = {
|
|
|
|
|
app = "headscale"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
template {
|
|
|
|
|
metadata {
|
|
|
|
|
labels = {
|
|
|
|
|
app = "headscale"
|
|
|
|
|
}
|
|
|
|
|
annotations = {
|
|
|
|
|
# "diun.enable" = "true"
|
|
|
|
|
"diun.enable" = "false"
|
|
|
|
|
"diun.include_tags" = "^\\d+(?:\\.\\d+)?(?:\\.\\d+)?$"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
spec {
|
|
|
|
|
container {
|
|
|
|
|
image = "headscale/headscale:0.23.0"
|
|
|
|
|
# image = "headscale/headscale:0.23.0-debug" # -debug is for debug images
|
|
|
|
|
name = "headscale"
|
|
|
|
|
command = ["headscale", "serve"]
|
[ci skip] Infrastructure hardening: security, monitoring, reliability, maintainability
Phase 1 - Critical Security:
- Netbox: move hardcoded DB/superuser passwords to variables
- MeshCentral: disable public registration, add Authentik auth
- Traefik: disable insecure API dashboard (api.insecure=false)
- Traefik: configure forwarded headers with Cloudflare trusted IPs
Phase 2 - Security Hardening:
- Add security headers middleware (HSTS, X-Frame-Options, nosniff, etc.)
- Add Kyverno pod security policies in audit mode (privileged, host
namespaces, SYS_ADMIN, trusted registries)
- Tighten rate limiting (avg=10, burst=50)
- Add Authentik protection to grampsweb
Phase 3 - Monitoring & Alerting:
- Add critical service alerts (PostgreSQL, MySQL, Redis, Headscale,
Authentik, Loki)
- Increase Loki retention from 7 to 30 days (720h)
- Add predictive PV filling alert (predict_linear)
- Re-enable Hackmd and Privatebin down alerts
Phase 4 - Reliability:
- Add resource requests/limits to Redis, DBaaS, Technitium, Headscale,
Vaultwarden, Uptime Kuma
- Increase Alloy DaemonSet memory to 512Mi/1Gi
Phase 6 - Maintainability:
- Extract duplicated tiers locals to terragrunt.hcl generate block
(removed from 67 stacks)
- Replace hardcoded NFS IP 10.0.10.15 with var.nfs_server (114
instances across 63 files)
- Replace hardcoded Redis/PostgreSQL/MySQL/Ollama/mail host references
with variables across ~35 stacks
- Migrate xray raw ingress resources to ingress_factory modules
2026-02-23 22:05:28 +00:00
|
|
|
|
|
|
|
|
resources {
|
|
|
|
|
requests = {
|
|
|
|
|
cpu = "50m"
|
2026-03-14 21:46:49 +00:00
|
|
|
memory = "128Mi"
|
[ci skip] Infrastructure hardening: security, monitoring, reliability, maintainability
Phase 1 - Critical Security:
- Netbox: move hardcoded DB/superuser passwords to variables
- MeshCentral: disable public registration, add Authentik auth
- Traefik: disable insecure API dashboard (api.insecure=false)
- Traefik: configure forwarded headers with Cloudflare trusted IPs
Phase 2 - Security Hardening:
- Add security headers middleware (HSTS, X-Frame-Options, nosniff, etc.)
- Add Kyverno pod security policies in audit mode (privileged, host
namespaces, SYS_ADMIN, trusted registries)
- Tighten rate limiting (avg=10, burst=50)
- Add Authentik protection to grampsweb
Phase 3 - Monitoring & Alerting:
- Add critical service alerts (PostgreSQL, MySQL, Redis, Headscale,
Authentik, Loki)
- Increase Loki retention from 7 to 30 days (720h)
- Add predictive PV filling alert (predict_linear)
- Re-enable Hackmd and Privatebin down alerts
Phase 4 - Reliability:
- Add resource requests/limits to Redis, DBaaS, Technitium, Headscale,
Vaultwarden, Uptime Kuma
- Increase Alloy DaemonSet memory to 512Mi/1Gi
Phase 6 - Maintainability:
- Extract duplicated tiers locals to terragrunt.hcl generate block
(removed from 67 stacks)
- Replace hardcoded NFS IP 10.0.10.15 with var.nfs_server (114
instances across 63 files)
- Replace hardcoded Redis/PostgreSQL/MySQL/Ollama/mail host references
with variables across ~35 stacks
- Migrate xray raw ingress resources to ingress_factory modules
2026-02-23 22:05:28 +00:00
|
|
|
}
|
|
|
|
|
limits = {
|
2026-03-14 21:46:49 +00:00
|
|
|
memory = "128Mi"
|
[ci skip] Infrastructure hardening: security, monitoring, reliability, maintainability
Phase 1 - Critical Security:
- Netbox: move hardcoded DB/superuser passwords to variables
- MeshCentral: disable public registration, add Authentik auth
- Traefik: disable insecure API dashboard (api.insecure=false)
- Traefik: configure forwarded headers with Cloudflare trusted IPs
Phase 2 - Security Hardening:
- Add security headers middleware (HSTS, X-Frame-Options, nosniff, etc.)
- Add Kyverno pod security policies in audit mode (privileged, host
namespaces, SYS_ADMIN, trusted registries)
- Tighten rate limiting (avg=10, burst=50)
- Add Authentik protection to grampsweb
Phase 3 - Monitoring & Alerting:
- Add critical service alerts (PostgreSQL, MySQL, Redis, Headscale,
Authentik, Loki)
- Increase Loki retention from 7 to 30 days (720h)
- Add predictive PV filling alert (predict_linear)
- Re-enable Hackmd and Privatebin down alerts
Phase 4 - Reliability:
- Add resource requests/limits to Redis, DBaaS, Technitium, Headscale,
Vaultwarden, Uptime Kuma
- Increase Alloy DaemonSet memory to 512Mi/1Gi
Phase 6 - Maintainability:
- Extract duplicated tiers locals to terragrunt.hcl generate block
(removed from 67 stacks)
- Replace hardcoded NFS IP 10.0.10.15 with var.nfs_server (114
instances across 63 files)
- Replace hardcoded Redis/PostgreSQL/MySQL/Ollama/mail host references
with variables across ~35 stacks
- Migrate xray raw ingress resources to ingress_factory modules
2026-02-23 22:05:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-22 14:38:14 +00:00
|
|
|
port {
|
|
|
|
|
container_port = 8080
|
|
|
|
|
}
|
|
|
|
|
port {
|
|
|
|
|
container_port = 9090
|
|
|
|
|
}
|
|
|
|
|
port {
|
|
|
|
|
container_port = 41641
|
|
|
|
|
}
|
|
|
|
|
|
[ci skip] iSCSI migration, healthcheck fixes, health probes, etcd backup
- Migrate MySQL/PostgreSQL storage from local-path to iscsi-truenas
- Add democratic-csi iSCSI driver module for TrueNAS
- Add open-iscsi to cloud-init VM template
- Fix Shlink health probe path (/api/v3 -> /rest/v3 for Shlink 5.0)
- Fix etcd backup: use etcd 3.5.21-0 (3.6.x is distroless, no /bin/sh)
- Fix cluster healthcheck CronJob: always exit 0 to prevent circular
JobFailed alerts (reporting via Slack, not exit codes)
- Fix Uptime Kuma nested list handling in cluster-health.sh
- Add health probes to: audiobookshelf, immich ML, ntfy, headscale,
uptime-kuma, vaultwarden, rybbit (clickhouse + server + client),
shlink, shlink-web
- Add iSCSI storage documentation to CLAUDE.md
2026-03-06 19:54:21 +00:00
|
|
|
liveness_probe {
|
|
|
|
|
http_get {
|
|
|
|
|
path = "/health"
|
|
|
|
|
port = 8080
|
|
|
|
|
}
|
|
|
|
|
initial_delay_seconds = 15
|
|
|
|
|
period_seconds = 30
|
|
|
|
|
timeout_seconds = 5
|
|
|
|
|
failure_threshold = 5
|
|
|
|
|
}
|
|
|
|
|
readiness_probe {
|
|
|
|
|
http_get {
|
|
|
|
|
path = "/health"
|
|
|
|
|
port = 8080
|
|
|
|
|
}
|
|
|
|
|
initial_delay_seconds = 5
|
|
|
|
|
period_seconds = 30
|
|
|
|
|
timeout_seconds = 5
|
|
|
|
|
failure_threshold = 3
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-22 14:38:14 +00:00
|
|
|
volume_mount {
|
|
|
|
|
name = "config-volume"
|
|
|
|
|
mount_path = "/etc/headscale"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
volume_mount {
|
|
|
|
|
mount_path = "/mnt"
|
|
|
|
|
name = "nfs-config"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
volume {
|
|
|
|
|
name = "config-volume"
|
|
|
|
|
config_map {
|
|
|
|
|
name = "headscale-config"
|
|
|
|
|
items {
|
|
|
|
|
key = "config.yaml"
|
|
|
|
|
path = "config.yaml"
|
|
|
|
|
}
|
|
|
|
|
items {
|
|
|
|
|
key = "acl.yaml"
|
|
|
|
|
path = "acl.yaml"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
volume {
|
|
|
|
|
name = "nfs-config"
|
[ci skip] complete NFS CSI migration: complex stacks + platform modules
Migrate remaining multi-volume stacks and all platform modules from
inline NFS volumes to CSI-backed PV/PVC with nfs-truenas StorageClass
(soft,timeo=30,retrans=3 mount options).
Complex stacks: openclaw (4 vols), immich (8 vols), frigate (2 vols),
nextcloud (2 vols + old PV replaced), rybbit (1 vol)
Remaining stacks: affine, ebook2audiobook, f1-stream, osm_routing,
real-estate-crawler
Platform modules: monitoring (prometheus, loki, alertmanager PVs
converted from native NFS to CSI), redis, dbaas, technitium,
headscale, vaultwarden, uptime-kuma, mailserver, infra-maintenance
2026-03-02 01:24:07 +00:00
|
|
|
persistent_volume_claim {
|
|
|
|
|
claim_name = module.nfs_data.claim_name
|
2026-02-22 14:38:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
# container {
|
|
|
|
|
# image = "simcu/headscale-ui:0.1.4"
|
|
|
|
|
# name = "headscale-ui"
|
|
|
|
|
# port {
|
|
|
|
|
# container_port = 80
|
|
|
|
|
# }
|
|
|
|
|
# }
|
|
|
|
|
container {
|
|
|
|
|
image = "ghcr.io/gurucomputing/headscale-ui:latest"
|
|
|
|
|
# image = "ghcr.io/tale/headplane:0.3.2"
|
|
|
|
|
name = "headscale-ui"
|
[ci skip] Infrastructure hardening: security, monitoring, reliability, maintainability
Phase 1 - Critical Security:
- Netbox: move hardcoded DB/superuser passwords to variables
- MeshCentral: disable public registration, add Authentik auth
- Traefik: disable insecure API dashboard (api.insecure=false)
- Traefik: configure forwarded headers with Cloudflare trusted IPs
Phase 2 - Security Hardening:
- Add security headers middleware (HSTS, X-Frame-Options, nosniff, etc.)
- Add Kyverno pod security policies in audit mode (privileged, host
namespaces, SYS_ADMIN, trusted registries)
- Tighten rate limiting (avg=10, burst=50)
- Add Authentik protection to grampsweb
Phase 3 - Monitoring & Alerting:
- Add critical service alerts (PostgreSQL, MySQL, Redis, Headscale,
Authentik, Loki)
- Increase Loki retention from 7 to 30 days (720h)
- Add predictive PV filling alert (predict_linear)
- Re-enable Hackmd and Privatebin down alerts
Phase 4 - Reliability:
- Add resource requests/limits to Redis, DBaaS, Technitium, Headscale,
Vaultwarden, Uptime Kuma
- Increase Alloy DaemonSet memory to 512Mi/1Gi
Phase 6 - Maintainability:
- Extract duplicated tiers locals to terragrunt.hcl generate block
(removed from 67 stacks)
- Replace hardcoded NFS IP 10.0.10.15 with var.nfs_server (114
instances across 63 files)
- Replace hardcoded Redis/PostgreSQL/MySQL/Ollama/mail host references
with variables across ~35 stacks
- Migrate xray raw ingress resources to ingress_factory modules
2026-02-23 22:05:28 +00:00
|
|
|
|
|
|
|
|
resources {
|
|
|
|
|
requests = {
|
|
|
|
|
cpu = "25m"
|
2026-03-14 21:46:49 +00:00
|
|
|
memory = "128Mi"
|
[ci skip] Infrastructure hardening: security, monitoring, reliability, maintainability
Phase 1 - Critical Security:
- Netbox: move hardcoded DB/superuser passwords to variables
- MeshCentral: disable public registration, add Authentik auth
- Traefik: disable insecure API dashboard (api.insecure=false)
- Traefik: configure forwarded headers with Cloudflare trusted IPs
Phase 2 - Security Hardening:
- Add security headers middleware (HSTS, X-Frame-Options, nosniff, etc.)
- Add Kyverno pod security policies in audit mode (privileged, host
namespaces, SYS_ADMIN, trusted registries)
- Tighten rate limiting (avg=10, burst=50)
- Add Authentik protection to grampsweb
Phase 3 - Monitoring & Alerting:
- Add critical service alerts (PostgreSQL, MySQL, Redis, Headscale,
Authentik, Loki)
- Increase Loki retention from 7 to 30 days (720h)
- Add predictive PV filling alert (predict_linear)
- Re-enable Hackmd and Privatebin down alerts
Phase 4 - Reliability:
- Add resource requests/limits to Redis, DBaaS, Technitium, Headscale,
Vaultwarden, Uptime Kuma
- Increase Alloy DaemonSet memory to 512Mi/1Gi
Phase 6 - Maintainability:
- Extract duplicated tiers locals to terragrunt.hcl generate block
(removed from 67 stacks)
- Replace hardcoded NFS IP 10.0.10.15 with var.nfs_server (114
instances across 63 files)
- Replace hardcoded Redis/PostgreSQL/MySQL/Ollama/mail host references
with variables across ~35 stacks
- Migrate xray raw ingress resources to ingress_factory modules
2026-02-23 22:05:28 +00:00
|
|
|
}
|
|
|
|
|
limits = {
|
|
|
|
|
memory = "128Mi"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-22 14:38:14 +00:00
|
|
|
port {
|
|
|
|
|
container_port = 8081
|
|
|
|
|
# container_port = 3000
|
|
|
|
|
}
|
|
|
|
|
env {
|
|
|
|
|
name = "HTTP_PORT"
|
|
|
|
|
value = "8081"
|
|
|
|
|
}
|
|
|
|
|
# env {
|
|
|
|
|
# name = "HTTPS_PORT"
|
|
|
|
|
# value = "8082"
|
|
|
|
|
# }
|
|
|
|
|
env {
|
|
|
|
|
name = "HEADSCALE_URL"
|
|
|
|
|
value = "http://localhost:8080"
|
|
|
|
|
}
|
|
|
|
|
env {
|
|
|
|
|
name = "COOKIE_SECRET"
|
|
|
|
|
value = "kekekekke"
|
|
|
|
|
}
|
|
|
|
|
env {
|
|
|
|
|
name = "ROOT_API_KEY"
|
|
|
|
|
value = "kekekekeke"
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-23 22:43:05 +00:00
|
|
|
dns_config {
|
|
|
|
|
option {
|
|
|
|
|
name = "ndots"
|
|
|
|
|
value = "2"
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-02-22 14:38:14 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
resource "kubernetes_service" "headscale" {
|
|
|
|
|
metadata {
|
|
|
|
|
name = "headscale"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
labels = {
|
|
|
|
|
"app" = "headscale"
|
|
|
|
|
}
|
|
|
|
|
annotations = {
|
|
|
|
|
"prometheus.io/scrape" = "true"
|
|
|
|
|
"prometheus.io/port" = "9090"
|
|
|
|
|
}
|
|
|
|
|
# annotations = {
|
|
|
|
|
# "metallb.universe.tf/allow-shared-ip" : "shared"
|
|
|
|
|
# }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
spec {
|
|
|
|
|
# type = "LoadBalancer"
|
|
|
|
|
# external_traffic_policy = "Cluster"
|
|
|
|
|
selector = {
|
|
|
|
|
app = "headscale"
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
port {
|
|
|
|
|
name = "headscale"
|
|
|
|
|
port = "8080"
|
|
|
|
|
protocol = "TCP"
|
|
|
|
|
}
|
|
|
|
|
port {
|
|
|
|
|
name = "headscale-ui"
|
|
|
|
|
port = "80"
|
|
|
|
|
target_port = 8081
|
|
|
|
|
# target_port = 3000
|
|
|
|
|
protocol = "TCP"
|
|
|
|
|
}
|
|
|
|
|
port {
|
|
|
|
|
name = "metrics"
|
|
|
|
|
port = "9090"
|
|
|
|
|
protocol = "TCP"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module "ingress" {
|
|
|
|
|
source = "../../../../modules/kubernetes/ingress_factory"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
name = "headscale"
|
|
|
|
|
port = 8080
|
|
|
|
|
tls_secret_name = var.tls_secret_name
|
2026-03-07 16:41:36 +00:00
|
|
|
extra_annotations = {
|
|
|
|
|
"gethomepage.dev/enabled" = "true"
|
|
|
|
|
"gethomepage.dev/name" = "Headscale"
|
|
|
|
|
"gethomepage.dev/description" = "VPN mesh network"
|
|
|
|
|
"gethomepage.dev/icon" = "headscale.png"
|
|
|
|
|
"gethomepage.dev/group" = "Identity & Security"
|
|
|
|
|
"gethomepage.dev/pod-selector" = ""
|
|
|
|
|
}
|
2026-02-22 14:38:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module "ingress-ui" {
|
|
|
|
|
source = "../../../../modules/kubernetes/ingress_factory"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
name = "headscale-ui"
|
|
|
|
|
host = "headscale"
|
|
|
|
|
service_name = "headscale"
|
|
|
|
|
port = 8081
|
|
|
|
|
ingress_path = ["/web"]
|
|
|
|
|
tls_secret_name = var.tls_secret_name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "kubernetes_service" "headscale-server" {
|
|
|
|
|
metadata {
|
|
|
|
|
name = "headscale-server"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
labels = {
|
|
|
|
|
"app" = "headscale"
|
|
|
|
|
}
|
|
|
|
|
annotations = {
|
|
|
|
|
"metallb.universe.tf/allow-shared-ip" : "shared"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
spec {
|
|
|
|
|
type = "LoadBalancer"
|
|
|
|
|
external_traffic_policy = "Cluster"
|
|
|
|
|
selector = {
|
|
|
|
|
app = "headscale"
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
# port {
|
|
|
|
|
# name = "headscale-tcp"
|
|
|
|
|
# port = "41641"
|
|
|
|
|
# protocol = "TCP"
|
|
|
|
|
# }
|
|
|
|
|
port {
|
|
|
|
|
name = "headscale-udp"
|
|
|
|
|
port = "41641"
|
|
|
|
|
protocol = "UDP"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "kubernetes_config_map" "headscale-config" {
|
|
|
|
|
metadata {
|
|
|
|
|
name = "headscale-config"
|
|
|
|
|
namespace = kubernetes_namespace.headscale.metadata[0].name
|
|
|
|
|
|
|
|
|
|
annotations = {
|
|
|
|
|
"reloader.stakater.com/match" = "true"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data = {
|
|
|
|
|
"config.yaml" = var.headscale_config
|
|
|
|
|
"acl.yaml" = var.headscale_acl
|
|
|
|
|
}
|
|
|
|
|
}
|