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:
@@ -7,7 +7,6 @@ job "ai-frontend" {
|
|||||||
group "openwebui" {
|
group "openwebui" {
|
||||||
count = 1
|
count = 1
|
||||||
|
|
||||||
# PIN TO HP1 (Corrected Hostname)
|
|
||||||
constraint {
|
constraint {
|
||||||
attribute = "${attr.unique.hostname}"
|
attribute = "${attr.unique.hostname}"
|
||||||
value = "hp1-home"
|
value = "hp1-home"
|
||||||
@@ -36,6 +35,7 @@ job "ai-frontend" {
|
|||||||
driver = "podman"
|
driver = "podman"
|
||||||
|
|
||||||
env {
|
env {
|
||||||
|
# REVERTED: Now using Consul DNS again
|
||||||
OLLAMA_BASE_URL = "http://ollama.service.consul:11434"
|
OLLAMA_BASE_URL = "http://ollama.service.consul:11434"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,6 +45,10 @@ job "ai-frontend" {
|
|||||||
volumes = [
|
volumes = [
|
||||||
"/mnt/local-ssd/nomad/stacks/ai/ai-frontend/openwebui:/app/backend/data"
|
"/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 {
|
resources {
|
||||||
@@ -58,7 +62,6 @@ job "ai-frontend" {
|
|||||||
group "lobechat" {
|
group "lobechat" {
|
||||||
count = 1
|
count = 1
|
||||||
|
|
||||||
# PIN TO HP1 (Corrected Hostname)
|
|
||||||
constraint {
|
constraint {
|
||||||
attribute = "${attr.unique.hostname}"
|
attribute = "${attr.unique.hostname}"
|
||||||
value = "hp1-home"
|
value = "hp1-home"
|
||||||
@@ -87,13 +90,21 @@ job "ai-frontend" {
|
|||||||
driver = "podman"
|
driver = "podman"
|
||||||
|
|
||||||
env {
|
env {
|
||||||
|
# REVERTED: Now using Consul DNS again
|
||||||
OLLAMA_PROXY_URL = "http://ollama.service.consul:11434"
|
OLLAMA_PROXY_URL = "http://ollama.service.consul:11434"
|
||||||
|
|
||||||
|
# Kept this in, but Authentik will handle security later as you noted
|
||||||
ACCESS_CODE = "securepassword123"
|
ACCESS_CODE = "securepassword123"
|
||||||
}
|
}
|
||||||
|
|
||||||
config {
|
config {
|
||||||
image = "docker.io/lobehub/lobe-chat"
|
# Pinned version for stability
|
||||||
|
image = "docker.io/lobehub/lobe-chat:v1.143.0"
|
||||||
ports = ["http"]
|
ports = ["http"]
|
||||||
|
|
||||||
|
# --- THE FIX: Point DNS to Consul Server ---
|
||||||
|
dns_servers = ["192.168.1.133"]
|
||||||
|
dns_search = ["service.consul"]
|
||||||
}
|
}
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
|
|||||||
Reference in New Issue
Block a user