feat(comfyui): add Dockerfile, playbook, and Terraform configurations for ComfyUI setup

This commit is contained in:
2025-06-08 21:18:53 +02:00
parent d969525b58
commit 359b6d47aa
18 changed files with 400 additions and 170 deletions
@@ -170,6 +170,7 @@ resource "kubernetes_ingress_v1" "reverse-proxy_ingress" {
}
resource "kubernetes_secret" "auth_token" {
count = var.auth_token != "" ? 1 : 0
metadata {
name = "auth-token-secret"
namespace = kubernetes_namespace.reverse_proxy.metadata[0].name
@@ -281,31 +282,34 @@ resource "kubernetes_deployment" "reverse_proxy" {
}
}
container {
name = "auth-sidecar"
image = "python:3.11-slim"
dynamic "container" {
for_each = var.auth_token != "" ? [1] : []
content {
name = "auth-sidecar"
image = "python:3.11-slim"
command = ["python", "/app/auth_server.py"]
command = ["python", "/app/auth_server.py"]
env {
name = "AUTH_TOKEN"
value_from {
secret_key_ref {
name = "auth-token-secret"
key = "token"
env {
name = "AUTH_TOKEN"
value_from {
secret_key_ref {
name = kubernetes_secret.auth_token[0].metadata[0].name
key = "token"
}
}
}
}
volume_mount {
name = "auth-script"
mount_path = "/app"
read_only = true
}
volume_mount {
name = "auth-script"
mount_path = "/app"
read_only = true
}
port {
container_port = 5000
name = "auth"
port {
container_port = 5000
name = "auth"
}
}
}
@@ -39,10 +39,10 @@ location = /auth {
%{ if l.private ~}
auth_request /auth<;
%{ endif ~}
set $upstream "%{ if l.upstream != "" ~}${l.upstream}%{ else ~}${upstream}%{ endif ~}";
%{ if l.rewrite != "" ~}
rewrite ${l.rewrite};
%{ endif ~}
set $upstream "%{ if l.upstream != "" ~}${l.upstream}%{ else ~}${upstream}%{ endif ~}";
proxy_pass $upstream;
proxy_http_version 1.1;
%{ for k,v in l.headers ~}
@@ -30,7 +30,7 @@ variable "services" {
description = "A list of services to be deployed"
type = map(object({
fqdn = list(string)
upstream = string
upstream = optional(string, "")
resolver = optional(string, "")
default_headers = optional(map(string), {}),
http_port = optional(number, 80)
@@ -53,4 +53,5 @@ variable "auth_token" {
description = "The authentication token to use for the reverse proxy"
type = string
sensitive = true
default = ""
}