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.
This commit is contained in:
2025-12-28 00:11:55 -05:00
parent d57cee3e48
commit 2958fece21

View File

@@ -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 {