diff --git a/backend/cmd/api-gateway/main.go b/backend/cmd/api-gateway/main.go index c3ec770..c4ed910 100644 --- a/backend/cmd/api-gateway/main.go +++ b/backend/cmd/api-gateway/main.go @@ -80,6 +80,14 @@ func main() { app.Get("/metrics", metrics.MetricsHandler()) + app.Get("/health", func(c *fiber.Ctx) error { + return c.JSON(fiber.Map{"status": "ok"}) + }) + + app.Get("/ready", func(c *fiber.Ctx) error { + return c.JSON(fiber.Map{"status": "ready"}) + }) + app.Use(middleware.JWT(middleware.JWTConfig{ Secret: cfg.JWTSecret, AuthSvcURL: cfg.AuthSvcURL, @@ -98,14 +106,6 @@ func main() { })) } - app.Get("/health", func(c *fiber.Ctx) error { - return c.JSON(fiber.Map{"status": "ok"}) - }) - - app.Get("/ready", func(c *fiber.Ctx) error { - return c.JSON(fiber.Map{"status": "ready"}) - }) - app.Post("/api/chat", handleChat) app.All("/api/*", handleProxy) diff --git a/backend/deploy/k8s/agent-svc.yaml b/backend/deploy/k8s/agent-svc.yaml index ad5d282..c7180bd 100644 --- a/backend/deploy/k8s/agent-svc.yaml +++ b/backend/deploy/k8s/agent-svc.yaml @@ -41,7 +41,7 @@ spec: periodSeconds: 20 readinessProbe: httpGet: - path: /ready + path: /health port: 3018 initialDelaySeconds: 10 periodSeconds: 15 diff --git a/backend/deploy/k8s/configmap.yaml b/backend/deploy/k8s/configmap.yaml index 75b44e8..42b7a06 100644 --- a/backend/deploy/k8s/configmap.yaml +++ b/backend/deploy/k8s/configmap.yaml @@ -8,6 +8,7 @@ data: CRAWL4AI_URL: "http://crawl4ai:11235" REDIS_URL: "redis://redis:6379" DATABASE_URL: "postgres://gooseek:gooseek@postgres:5432/gooseek?sslmode=disable" + CHAT_SVC_URL: "http://chat-svc:3005" DISCOVER_SVC_URL: "http://discover-svc:3002" MASTER_AGENTS_SVC_URL: "http://agent-svc:3018" SEARCH_SVC_URL: "http://search-svc:3001" @@ -23,6 +24,7 @@ data: AUTH_SVC_URL: "http://auth-svc:3050" TRAVEL_SVC_URL: "http://travel-svc:3035" ADMIN_SVC_URL: "http://admin-svc:3040" + API_GATEWAY_URL: "http://api-gateway:3015" OLLAMA_BASE_URL: "http://ollama:11434" OLLAMA_MODEL: "qwen3.5:9b" OLLAMA_EMBEDDING_MODEL: "qwen3-embedding:0.6b" diff --git a/backend/deploy/k8s/deploy.sh b/backend/deploy/k8s/deploy.sh index d2afd14..9726372 100755 --- a/backend/deploy/k8s/deploy.sh +++ b/backend/deploy/k8s/deploy.sh @@ -88,9 +88,10 @@ echo "=== Applying sandbox namespace resources ===" kubectl apply -f "$SCRIPT_DIR/sandbox-namespace.yaml" kubectl apply -f "$SCRIPT_DIR/opensandbox-sandbox-ns.yaml" -# Clean up misplaced quota/limitrange from gooseek namespace (legacy fix) +# Clean up misplaced sandbox resources from gooseek namespace (legacy fix) kubectl delete resourcequota sandbox-quota -n gooseek --ignore-not-found=true 2>/dev/null || true kubectl delete limitrange sandbox-limits -n gooseek --ignore-not-found=true 2>/dev/null || true +kubectl delete networkpolicy sandbox-isolation -n gooseek --ignore-not-found=true 2>/dev/null || true # Apply kustomization echo "" diff --git a/backend/deploy/k8s/ingress.yaml b/backend/deploy/k8s/ingress.yaml index 993e851..cebb104 100644 --- a/backend/deploy/k8s/ingress.yaml +++ b/backend/deploy/k8s/ingress.yaml @@ -21,6 +21,13 @@ spec: - host: gooseek.ru http: paths: + - path: /api + pathType: Prefix + backend: + service: + name: api-gateway + port: + number: 3015 - path: / pathType: Prefix backend: diff --git a/backend/deploy/k8s/scraper-svc.yaml b/backend/deploy/k8s/scraper-svc.yaml index cbf24bc..5477ad5 100644 --- a/backend/deploy/k8s/scraper-svc.yaml +++ b/backend/deploy/k8s/scraper-svc.yaml @@ -39,7 +39,7 @@ spec: periodSeconds: 15 readinessProbe: httpGet: - path: /ready + path: /health port: 3021 initialDelaySeconds: 5 periodSeconds: 10 diff --git a/backend/deploy/k8s/search-svc.yaml b/backend/deploy/k8s/search-svc.yaml index 1c25471..d7c34e4 100644 --- a/backend/deploy/k8s/search-svc.yaml +++ b/backend/deploy/k8s/search-svc.yaml @@ -39,7 +39,7 @@ spec: periodSeconds: 15 readinessProbe: httpGet: - path: /ready + path: /health port: 3001 initialDelaySeconds: 5 periodSeconds: 10 diff --git a/backend/webui/next.config.mjs b/backend/webui/next.config.mjs index 6fa4c9c..94a5814 100644 --- a/backend/webui/next.config.mjs +++ b/backend/webui/next.config.mjs @@ -1,12 +1,22 @@ /** @type {import('next').NextConfig} */ +const API_GATEWAY = process.env.API_GATEWAY_URL || process.env.API_URL || 'http://api-gateway:3015'; + const nextConfig = { output: 'standalone', reactStrictMode: true, env: { - API_URL: process.env.API_URL || 'http://localhost:3015', + API_URL: API_GATEWAY, NEXT_PUBLIC_TWOGIS_API_KEY: process.env.NEXT_PUBLIC_TWOGIS_API_KEY || process.env.TWOGIS_API_KEY || '', NEXT_PUBLIC_ENABLED_ROUTES: process.env.NEXT_PUBLIC_ENABLED_ROUTES || '', }, + async rewrites() { + return [ + { + source: '/api/:path*', + destination: `${API_GATEWAY}/api/:path*`, + }, + ]; + }, }; export default nextConfig;