fix: resolve WebUI API proxy ECONNREFUSED and configmap placeholder issues
Some checks failed
Build and Deploy GooSeek / build-and-deploy (push) Has been cancelled

- Fix route handlers to use API_GATEWAY_URL env var with correct K8s fallback
  instead of localhost:3015
- Replace ${} placeholders in configmap.yaml with actual static values to
  prevent kustomize from overwriting envsubst-generated config
- Separate secrets into dedicated secrets.yaml for envsubst processing
- Update deploy.sh to only envsubst secrets (configmap now has static values)

Made-with: Cursor
This commit is contained in:
home
2026-03-03 04:16:57 +03:00
parent 32102c379a
commit 1c1a10eb35
6 changed files with 92 additions and 94 deletions

View File

@@ -71,12 +71,13 @@ echo "=== Pushing webui to registry ==="
docker push "$REGISTRY/gooseek/webui:$IMAGE_TAG"
docker push "$REGISTRY/gooseek/webui:latest"
# Generate configmap/secrets from .env via envsubst
# Generate secrets from .env via envsubst (configmap has static values)
echo ""
echo "=== Generating K8s manifests from .env ==="
echo "=== Generating K8s secrets from .env ==="
if command -v envsubst &> /dev/null && [ -f "$ENV_FILE" ]; then
envsubst < "$SCRIPT_DIR/configmap.yaml" > "$SCRIPT_DIR/_generated_configmap.yaml"
kubectl apply -f "$SCRIPT_DIR/_generated_configmap.yaml" -n gooseek
envsubst < "$SCRIPT_DIR/secrets.yaml" > "$SCRIPT_DIR/_generated_secrets.yaml"
kubectl apply -f "$SCRIPT_DIR/_generated_secrets.yaml" -n gooseek
rm -f "$SCRIPT_DIR/_generated_secrets.yaml"
# Generate monitoring manifests
envsubst < "$SCRIPT_DIR/monitoring.yaml" > "$SCRIPT_DIR/_generated_monitoring.yaml"