From f04862f6f7ecaa5ee21517ab2a9aa36993815472 Mon Sep 17 00:00:00 2001 From: "d.viti" Date: Thu, 9 Oct 2025 15:18:51 +0200 Subject: [PATCH] Configure Ingress to route traffic through API7 Gateway MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- helm/api7ee-demo-k8s/templates/ingress.yaml | 9 +++++++++ helm/api7ee-demo-k8s/values.yaml | 20 +++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/helm/api7ee-demo-k8s/templates/ingress.yaml b/helm/api7ee-demo-k8s/templates/ingress.yaml index 862c1ec..99b8ea3 100644 --- a/helm/api7ee-demo-k8s/templates/ingress.yaml +++ b/helm/api7ee-demo-k8s/templates/ingress.yaml @@ -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 }} \ No newline at end of file diff --git a/helm/api7ee-demo-k8s/values.yaml b/helm/api7ee-demo-k8s/values.yaml index 916ac04..135b553 100644 --- a/helm/api7ee-demo-k8s/values.yaml +++ b/helm/api7ee-demo-k8s/values.yaml @@ -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