Files
nomad/stacks/ai/ai-frontend.nomad
Preston Hunter 93876ad444 refactor(nomad): Centralize DNS configuration for AI frontends
Moves DNS server and search domain configuration from task `config` blocks to the job/group `network` blocks for `ai-frontend` (OpenWebUI) and `lobechat`.

This refactoring centralizes DNS settings for all tasks within a Nomad job or group, ensuring consistent DNS resolution and aligning with recommended Nomad configuration patterns.
2025-12-28 10:57:15 -05:00

119 lines
2.2 KiB
HCL

job "ai-frontend" {
datacenters = ["Homelab-PTECH-DC"]
region = "home"
type = "service"
# --- OpenWebUI ---
group "openwebui" {
count = 1
constraint {
attribute = "${attr.unique.hostname}"
value = "hp1-home"
}
network {
port "http" {
static = 8080
to = 8080
}
# ✅ DNS Moved Here
dns {
servers = ["192.168.1.133"]
searches = ["service.consul"]
}
}
service {
name = "openwebui"
port = "http"
tags = ["traefik.enable=true"]
check {
type = "http"
path = "/health"
interval = "20s"
timeout = "2s"
}
}
task "server" {
driver = "podman"
env {
OLLAMA_BASE_URL = "http://ollama.service.consul:11434"
}
config {
image = "ghcr.io/open-webui/open-webui:main"
ports = ["http"]
volumes = [
"/mnt/local-ssd/nomad/stacks/ai/ai-frontend/openwebui:/app/backend/data"
]
# Removed invalid dns_servers/dns_search from here
}
resources {
cpu = 1000
memory = 1024
}
}
}
# --- LobeChat ---
group "lobechat" {
count = 1
constraint {
attribute = "${attr.unique.hostname}"
value = "hp1-home"
}
network {
port "http" {
static = 3210
to = 3210
}
# ✅ DNS Moved Here
dns {
servers = ["192.168.1.133"]
searches = ["service.consul"]
}
}
service {
name = "lobechat"
port = "http"
tags = ["traefik.enable=true"]
check {
type = "http"
path = "/"
interval = "20s"
timeout = "2s"
}
}
task "server" {
driver = "podman"
env {
OLLAMA_PROXY_URL = "http://ollama.service.consul:11434"
ACCESS_CODE = "securepassword123"
}
config {
image = "docker.io/lobehub/lobe-chat:v1.143.0"
ports = ["http"]
# Removed invalid dns_servers/dns_search from here
}
resources {
cpu = 500
memory = 1024
}
}
}
}