fix(llm): make API URL configurable for Kubernetes internal service
ci / test (push) Successful in 1m51s

Issue: Orchestrator pods failing with 'api.riotpiao.com is unreachable'
- URL was hardcoded to external hostname
- Inside Kubernetes cluster, needs to use internal service DNS

Changes:
- Make LocalLLMBaseURL read from LOCAL_LLM_BASE_URL env var
- Default to 'https://api.riotpiao.com' for external deployments
- Update orchestrator-job.yaml to pass internal service: http://api-gateway.api:8080
- Update worker-deployment.yaml to use same internal service URL

This allows pods to reach the LLM API via Kubernetes DNS without external network access.
This commit is contained in:
Test
2026-08-31 14:49:30 -07:00
parent 9b9e99da3e
commit db71919207
4 changed files with 20 additions and 7 deletions
+12 -3
View File
@@ -7,16 +7,25 @@ import (
"fmt"
"io"
"net/http"
"os"
"github.com/rockliang/poimen/workflows/statemachine"
)
const (
var (
// LocalLLMBaseURL is the base URL for the local LLM API (OpenAI-compatible)
// Points to homelab-frontend gateway
LocalLLMBaseURL = "https://api.riotpiao.com"
// Can be overridden via LOCAL_LLM_BASE_URL env var (for Kubernetes internal service)
LocalLLMBaseURL string
)
func init() {
LocalLLMBaseURL = os.Getenv("LOCAL_LLM_BASE_URL")
if LocalLLMBaseURL == "" {
// Default: external hostname (for local dev)
LocalLLMBaseURL = "https://api.riotpiao.com"
}
}
var (
// SupportedModels maps local model names to verify they exist
SupportedModels = map[string]bool{