Configure Ingress to route traffic through API7 Gateway
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 46s
Build and Deploy / build-web (push) Successful in 1m7s

Modified Ingress configuration to route all traffic through the API7
Gateway (gateway-0-1759393614-gateway) instead of directly to application
services. This enables API7's advanced routing, rate limiting, CORS, and
other gateway features.

Changes:
- Updated ingress.yaml template to support gateway backend routing
- Modified values.yaml to route traffic to API7 Gateway service
- Disabled web and api services (now optional) as routing is handled by API7
- Removed nginx.ingress.kubernetes.io/rewrite-target annotation
- Maintained backward compatibility with legacy service-based routing

The Ingress now directs traffic to the API7 Gateway which handles all
routing logic defined in the ADC configuration.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
d.viti
2025-10-09 15:18:51 +02:00
parent 305e0cc848
commit f04862f6f7
2 changed files with 22 additions and 7 deletions

View File

@@ -32,6 +32,14 @@ spec:
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
{{- if .gateway }}
{{- /* Use API7 Gateway as backend */}}
service:
name: {{ .gateway.serviceName }}
port:
number: {{ .gateway.port | default 80 }}
{{- else if .service }}
{{- /* Legacy: Use application service as backend */}}
service:
{{- if eq .service "web" }}
name: {{ include "api7ee.fullname" $ }}-web
@@ -42,6 +50,7 @@ spec:
port:
number: {{ $.Values.api.service.port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

View File

@@ -10,7 +10,7 @@ global:
# Configuration for the Web component
web:
enabled: true
enabled: false # Disabled when using API7 Gateway routing
replicaCount: 2
image:
@@ -68,7 +68,7 @@ web:
# Configuration for the API component
api:
enabled: true
enabled: false # Disabled when using API7 Gateway routing
replicaCount: 3
image:
@@ -131,7 +131,6 @@ ingress:
enabled: true
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
cert-manager.io/cluster-issuer: "cloudflare-acme-prod"
hosts:
@@ -139,10 +138,17 @@ ingress:
paths:
- path: /
pathType: Prefix
service: web # Routes to web service
- path: /api
pathType: Prefix
service: api # Routes to API service
# Route to API7 Gateway instead of direct service
gateway:
serviceName: gateway-0-1759393614-gateway
port: 80
# Legacy configuration (commented out - use gateway instead)
# - path: /
# pathType: Prefix
# service: web # Routes to web service
# - path: /api
# pathType: Prefix
# service: api # Routes to API service
tls:
- secretName: api7ee-tls