Files
api7-demo/helm/api7ee-demo-k8s/templates/ingress.yaml
d.viti f04862f6f7
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
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>
2025-10-09 15:18:51 +02:00

56 lines
1.7 KiB
YAML

{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "api7ee.fullname" . }}
labels:
{{- include "api7ee.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- 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
port:
number: {{ $.Values.web.service.port }}
{{- else if eq .service "api" }}
name: {{ include "api7ee.fullname" $ }}-api
port:
number: {{ $.Values.api.service.port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}