From 2958fece21157ee292b6c65006017a5596a336ff Mon Sep 17 00:00:00 2001 From: Preston Hunter Date: Sun, 28 Dec 2025 00:11:55 -0500 Subject: [PATCH] fix(ai-frontend): Configure Consul DNS for service discovery This commit addresses service discovery issues by explicitly configuring Consul DNS for the `openwebui` and `lobechat` tasks within the `ai-frontend` job. Previously, services were unable to reliably resolve `ollama.service.consul`. This is resolved by: * Setting `dns_servers` to the Consul server IP (`192.168.1.133`). * Setting `dns_search` to `service.consul`. * Reverting `OLLAMA_BASE_URL` and `OLLAMA_PROXY_URL` environment variables to use `ollama.service.consul` as intended. * The `lobechat` task's image is now pinned to `v1.143.0` for improved stability. * Removed outdated comments regarding host pinning. --- stacks/ai/ai-frontend.nomad | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/stacks/ai/ai-frontend.nomad b/stacks/ai/ai-frontend.nomad index 9c2e22d..c8f733c 100644 --- a/stacks/ai/ai-frontend.nomad +++ b/stacks/ai/ai-frontend.nomad @@ -7,7 +7,6 @@ job "ai-frontend" { group "openwebui" { count = 1 - # PIN TO HP1 (Corrected Hostname) constraint { attribute = "${attr.unique.hostname}" value = "hp1-home" @@ -36,6 +35,7 @@ job "ai-frontend" { driver = "podman" env { + # REVERTED: Now using Consul DNS again OLLAMA_BASE_URL = "http://ollama.service.consul:11434" } @@ -45,6 +45,10 @@ job "ai-frontend" { volumes = [ "/mnt/local-ssd/nomad/stacks/ai/ai-frontend/openwebui:/app/backend/data" ] + + # --- THE FIX: Point DNS to Consul Server --- + dns_servers = ["192.168.1.133"] + dns_search = ["service.consul"] } resources { @@ -58,7 +62,6 @@ job "ai-frontend" { group "lobechat" { count = 1 - # PIN TO HP1 (Corrected Hostname) constraint { attribute = "${attr.unique.hostname}" value = "hp1-home" @@ -87,13 +90,21 @@ job "ai-frontend" { driver = "podman" env { + # REVERTED: Now using Consul DNS again OLLAMA_PROXY_URL = "http://ollama.service.consul:11434" + + # Kept this in, but Authentik will handle security later as you noted ACCESS_CODE = "securepassword123" } config { - image = "docker.io/lobehub/lobe-chat" + # Pinned version for stability + image = "docker.io/lobehub/lobe-chat:v1.143.0" ports = ["http"] + + # --- THE FIX: Point DNS to Consul Server --- + dns_servers = ["192.168.1.133"] + dns_search = ["service.consul"] } resources {