Commit Graph

13 Commits

Author SHA1 Message Date
d.viti
a0dee1d499 Add proxy-rewrite plugin to remove /api prefix
Some checks failed
Helm Chart Build / lint-only (push) Has been skipped
Build and Deploy / build-web (push) Failing after 7s
Helm Chart Build / build-helm (push) Successful in 12s
Build and Deploy / build-api (push) Successful in 42s
Added proxy-rewrite plugin to strip /api prefix from requests before
forwarding to backend API microservice. The API service is a standalone
microservice that expects requests without the /api prefix.

Changes:
- Added proxy-rewrite plugin to both API routes:
  * /api/llm/* route (priority 20)
  * /api/* route (priority 10)
- Uses regex_uri to rewrite: /api/endpoint -> /endpoint

Example transformations:
- /api/health -> /health
- /api/users/123 -> /users/123
- /api/llm/chat -> /llm/chat

Plugin configuration:
  proxy-rewrite:
    regex_uri:
      - "^/api/(.*)"
      - "/$1"

This allows the API microservice to work independently without
needing to handle the /api prefix in its routes.

Reference: https://docs.api7.ai/hub/proxy-rewrite/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 17:05:24 +02:00
d.viti
84718e5039 Fix ADC service discovery configuration syntax
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 9s
Build and Deploy / build-api (push) Successful in 47s
Build and Deploy / build-web (push) Successful in 1m10s
Fixed service discovery configuration to use correct ADC syntax.
The namespace should be included in the service_name, not as a
separate namespace_id field.

Error:
✖ Unrecognized key: "namespace_id"
  → at services[0].upstream

Fix:
- Changed from: service_name: my-service + namespace_id: namespace
- Changed to: service_name: namespace/my-service

This matches the ADC/API7 expected format for Kubernetes service
discovery: "namespace/service-name"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 16:36:16 +02:00
d.viti
e995482bfd Enable Kubernetes Service Discovery for API7 Gateway upstreams
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 9s
Build and Deploy / build-api (push) Successful in 43s
Build and Deploy / build-web (push) Successful in 1m1s
Configured API7 Gateway to use Kubernetes Service Discovery instead of
static upstream nodes. This enables dynamic discovery of backend Pods
through the Kubernetes API.

Benefits:
- Automatic scaling: New Pods are automatically added to upstream pool
- Health checks: Only healthy Pods receive traffic
- Zero downtime: Automatic updates during deployments and rollouts
- No manual upstream configuration needed

Changes:
- Updated configmap-adc.yaml to use discovery_type: kubernetes
- Service discovery queries Kubernetes API for Pod endpoints
- Falls back to static nodes if serviceDiscovery.enabled is false
- Added documentation in values.yaml explaining the feature

The RBAC permissions (services, endpoints watch) were already configured
in rbac-adc.yaml, so no additional permissions are needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-09 15:24:29 +02:00
d.viti
29ef0c65e5 Fix global_rules section to be conditionally included
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 8s
Build and Deploy / build-api (push) Successful in 40s
Build and Deploy / build-web (push) Successful in 1m6s
Made the global_rules section conditional on logging being enabled.
Previously, when logging was disabled, global_rules was rendered as
an empty object (null), causing a lint error:
"Invalid input: expected record, received null at global_rules"

Now the entire global_rules section is only included when there are
actual rules to add.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-08 19:36:10 +02:00
d.viti
10b3c2a480 Remove prometheus global rule causing plugin not found error
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 1m33s
Build and Deploy / build-web (push) Successful in 3m9s
Build and Deploy / build-api (push) Successful in 3m12s
Removed the prometheus-metrics global rule configuration which was
causing "custom plugin (prometheus-metrics) not found" error.

API7 Enterprise doesn't support prometheus as a global rule plugin
in this configuration format. Prometheus metrics can be configured
differently if needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-08 19:22:44 +02:00
d.viti
8be1f85718 Fix CORS plugin configuration for API7 Enterprise
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 2m22s
Build and Deploy / build-api (push) Successful in 4m6s
Build and Deploy / build-web (push) Successful in 4m33s
Changed CORS plugin array values to comma-separated strings:
- allow_origins: from JSON array to comma-separated string
- allow_methods: from JSON array to comma-separated string
- allow_headers: from JSON array to comma-separated string
- expose_headers: from JSON array to comma-separated string

API7 Enterprise expects string values with comma-separated items,
not JSON arrays. This fixes the validation error:
"Invalid type. Expected: string, given: array"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-08 18:58:09 +02:00
d.viti
05b013d378 Fix ADC global_rules format from array to object
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 9s
Build and Deploy / build-api (push) Successful in 49s
Build and Deploy / build-web (push) Successful in 1m3s
Changed global_rules from array format (- id: name) to object format
(name:) to match ADC schema requirements. This fixes the lint error:
"Invalid input: expected record, received array at global_rules"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-08 17:51:45 +02:00
d.viti
b2e0d5bd10 Refactor Helm chart for API7EE: clarify gateway requirements, improve
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 31s
Build and Deploy / build-api (push) Successful in 1m14s
Build and Deploy / build-web (push) Successful in 1m36s
ADC config templating, and enhance gateway health checks
2025-10-08 13:44:01 +02:00
d.viti
d17e356fcd Simplify Docker build workflow and update routing rules
Some checks failed
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 8s
Build and Deploy / build-web (push) Failing after 45s
Build and Deploy / build-api (push) Successful in 53s
2025-10-07 18:31:56 +02:00
d.viti
2d695ba361 Update ADC config to handle /docs route separately
Some checks failed
Helm Chart Build / lint-only (push) Has been skipped
Build and Deploy / build-web (push) Failing after 8s
Helm Chart Build / build-helm (push) Successful in 8s
Build and Deploy / build-api (push) Successful in 25s
Add a new route for /docs and /docs/* with higher priority. Exclude
/docs from the default route's URI regex to prevent overlap.
2025-10-07 18:15:30 +02:00
d.viti
ed660dce5a Add LLM endpoints, web frontend, and rate limiting config
Some checks failed
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 9s
Build and Deploy / build-api (push) Successful in 33s
Build and Deploy / build-web (push) Failing after 41s
- Added OpenAI-compatible LLM endpoints to API backend - Introduced web
frontend with Jinja2 templates and static assets - Implemented API proxy
routes in web service - Added sample db.json data for items, users,
orders, reviews, categories, llm_requests - Updated ADC and Helm configs
for separate AI and standard rate limiting - Upgraded FastAPI, Uvicorn,
and added httpx, Jinja2, python-multipart dependencies - Added API
configuration modal and client-side JS for web app
2025-10-07 17:29:12 +02:00
d.viti
e156b7c7a1 Refactor ADC config to use AI rate limiting for /api route 2025-10-07 15:01:22 +02:00
d.viti
f9d529ac87 Rename Helm chart to api7ee-demo-k8s
- Changed chart name from api7ee to api7ee-demo-k8s in Chart.yaml
- Renamed helm/api7ee directory to helm/api7ee-demo-k8s
- Updated all references in build.yml workflow
- Updated all references in helm-release.yml workflow
- Updated main README.md with new chart name
- Updated Helm chart README with new chart name
- Verified all old references have been replaced
- Chart packages correctly as api7ee-demo-k8s-{version}.tgz
2025-10-03 02:31:23 +02:00