Configure Ingress to route traffic through API7 Gateway
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:
@@ -32,6 +32,14 @@ spec:
|
|||||||
- path: {{ .path }}
|
- path: {{ .path }}
|
||||||
pathType: {{ .pathType }}
|
pathType: {{ .pathType }}
|
||||||
backend:
|
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:
|
service:
|
||||||
{{- if eq .service "web" }}
|
{{- if eq .service "web" }}
|
||||||
name: {{ include "api7ee.fullname" $ }}-web
|
name: {{ include "api7ee.fullname" $ }}-web
|
||||||
@@ -42,6 +50,7 @@ spec:
|
|||||||
port:
|
port:
|
||||||
number: {{ $.Values.api.service.port }}
|
number: {{ $.Values.api.service.port }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
@@ -10,7 +10,7 @@ global:
|
|||||||
|
|
||||||
# Configuration for the Web component
|
# Configuration for the Web component
|
||||||
web:
|
web:
|
||||||
enabled: true
|
enabled: false # Disabled when using API7 Gateway routing
|
||||||
replicaCount: 2
|
replicaCount: 2
|
||||||
|
|
||||||
image:
|
image:
|
||||||
@@ -68,7 +68,7 @@ web:
|
|||||||
|
|
||||||
# Configuration for the API component
|
# Configuration for the API component
|
||||||
api:
|
api:
|
||||||
enabled: true
|
enabled: false # Disabled when using API7 Gateway routing
|
||||||
replicaCount: 3
|
replicaCount: 3
|
||||||
|
|
||||||
image:
|
image:
|
||||||
@@ -131,7 +131,6 @@ ingress:
|
|||||||
enabled: true
|
enabled: true
|
||||||
className: "nginx"
|
className: "nginx"
|
||||||
annotations:
|
annotations:
|
||||||
nginx.ingress.kubernetes.io/rewrite-target: /
|
|
||||||
cert-manager.io/cluster-issuer: "cloudflare-acme-prod"
|
cert-manager.io/cluster-issuer: "cloudflare-acme-prod"
|
||||||
|
|
||||||
hosts:
|
hosts:
|
||||||
@@ -139,10 +138,17 @@ ingress:
|
|||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
service: web # Routes to web service
|
# Route to API7 Gateway instead of direct service
|
||||||
- path: /api
|
gateway:
|
||||||
pathType: Prefix
|
serviceName: gateway-0-1759393614-gateway
|
||||||
service: api # Routes to API service
|
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:
|
tls:
|
||||||
- secretName: api7ee-tls
|
- secretName: api7ee-tls
|
||||||
|
|||||||
Reference in New Issue
Block a user