Files
api7-demo/helm/api7ee-demo-k8s/templates/configmap-adc.yaml
d.viti ed660dce5a
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
Add LLM endpoints, web frontend, and rate limiting config
- 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

113 lines
3.6 KiB
YAML

{{- if .Values.api7.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "api7ee.fullname" . }}-adc-config
labels:
{{- include "api7ee.labels" . | nindent 4 }}
app.kubernetes.io/component: adc
data:
adc-config.yaml: |
services:
- name: apache-service
hosts:
- {{ (first .Values.api7.hosts) | quote }}
upstream:
name: apache-upstream
scheme: http
type: roundrobin
nodes:
- host: apache-service.{{ .Release.Namespace }}.svc.cluster.local
port: 80
weight: 100
routes:
- name: apache-route
uris:
- /*
vars:
- - uri
- "~~"
- "^(?!/api)"
priority: 1
plugins:
{{- if .Values.api7.tls.enabled }}
redirect:
http_to_https: true
{{- end }}
- name: nginx-api-service
hosts:
- {{ (first .Values.api7.hosts) | quote }}
upstream:
name: nginx-upstream
scheme: http
type: roundrobin
nodes:
- host: nginx-service.{{ .Release.Namespace }}.svc.cluster.local
port: 80
weight: 100
routes:
- name: nginx-api-llm-route
uris:
- /api/llm
- /api/llm/*
priority: 20
plugins:
{{- if .Values.api7.tls.enabled }}
redirect:
http_to_https: true
{{- end }}
{{- if .Values.api7.plugins.aiRateLimit.enabled }}
ai-rate-limiting:
limit: {{ .Values.api7.plugins.aiRateLimit.limit }}
time_window: {{ .Values.api7.plugins.aiRateLimit.timeWindow }}
rejected_code: {{ .Values.api7.plugins.aiRateLimit.rejectedCode }}
limit_strategy: {{ .Values.api7.plugins.aiRateLimit.limitStrategy | quote }}
{{- end }}
- name: nginx-api-route
uris:
- /api
- /api/*
priority: 10
plugins:
{{- if .Values.api7.tls.enabled }}
redirect:
http_to_https: true
{{- end }}
{{- if .Values.api7.plugins.rateLimit.enabled }}
limit-count:
count: {{ .Values.api7.plugins.rateLimit.count }}
time_window: {{ .Values.api7.plugins.rateLimit.timeWindow }}
rejected_code: {{ .Values.api7.plugins.rateLimit.rejectedCode }}
key_type: {{ .Values.api7.plugins.rateLimit.keyType | quote }}
key: {{ .Values.api7.plugins.rateLimit.key | quote }}
{{- end }}
{{- if .Values.api7.plugins.auth.enabled }}
consumers:
{{- range .Values.api7.consumers }}
- username: {{ .username }}
plugins:
key-auth:
key: {{ .apiKey }}
{{- end }}
{{- end }}
global_rules:
{{- if .Values.api7.plugins.prometheus.enabled }}
- id: prometheus-metrics
plugins:
prometheus:
prefer_name: true
{{- end }}
{{- if .Values.api7.plugins.logging.enabled }}
- id: request-logging
plugins:
http-logger:
uri: {{ .Values.api7.plugins.logging.endpoint }}
batch_max_size: {{ .Values.api7.plugins.logging.batchMaxSize | default 1000 }}
inactive_timeout: {{ .Values.api7.plugins.logging.inactiveTimeout | default 5 }}
{{- end }}
{{- end }}