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.
This commit is contained in:
2025-12-28 10:57:15 -05:00
parent 00de9d60fa
commit 93876ad444

View File

@@ -17,15 +17,22 @@ job "ai-frontend" {
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" # OpenWebUI actually HAS this endpoint
path = "/health"
interval = "20s"
timeout = "2s"
}
@@ -44,10 +51,7 @@ job "ai-frontend" {
volumes = [
"/mnt/local-ssd/nomad/stacks/ai/ai-frontend/openwebui:/app/backend/data"
]
# DNS Fix
dns_servers = ["192.168.1.133"]
dns_search = ["service.consul"]
# Removed invalid dns_servers/dns_search from here
}
resources {
@@ -71,6 +75,12 @@ job "ai-frontend" {
static = 3210
to = 3210
}
# ✅ DNS Moved Here
dns {
servers = ["192.168.1.133"]
searches = ["service.consul"]
}
}
service {
@@ -78,8 +88,6 @@ job "ai-frontend" {
port = "http"
tags = ["traefik.enable=true"]
# --- THE FIX ---
# Changed from /api/health to / (Root)
check {
type = "http"
path = "/"
@@ -99,10 +107,7 @@ job "ai-frontend" {
config {
image = "docker.io/lobehub/lobe-chat:v1.143.0"
ports = ["http"]
# DNS Fix
dns_servers = ["192.168.1.133"]
dns_search = ["service.consul"]
# Removed invalid dns_servers/dns_search from here
}
resources {