Gateway and APISIX Route Links

Auto-generates route/{service}.yaml files with ApisixRoute + ApisixUpstream CRDs per linked component

Three Link Patterns

apisix-* (Direct)
Direct route to component
e.g. apisix-fastapi, apisix-grafana
gateway-* (Sub-component)
Custom route via gateway sub-component
gateway-external_source_code
ai_gateway-* (AI Sub-component)
AI/LLM gateway routes
ai_gateway-vllm, ai_gateway-model, ai_gateway-external_ai

Direct APISIX Links (apisix-*)

Each generates route/{service}.yaml. Removed by post_gen if link doesn't exist.

apisix-fastapi apisix-external_source_code apisix-image_base apisix-python apisix-bridge apisix-grafana apisix-prometheus apisix-loki apisix-minio apisix-keycloak apisix-keycloak_operator apisix-rabbitmq apisix-langflow apisix-vllm apisix-open-webui apisix-flowise apisix-backstage apisix-clickhouse apisix-opensearch apisix-dex apisix-postgresql apisix-kubecost apisix-stack_agent

Route Link Attributes

Set on each apisix-* link to configure the generated route.

Attribute Example Plugin / Effect
subdomain api Host: {subdomain}.{domain}
cors true cors plugin (allow_origins: *)
rate_limiting true limit-count (100/60s)
apisix_oidc_enable true openid-connect plugin
whitelist true ip-restriction plugin
proxy_rewrite true proxy-rewrite plugin
websocket true WebSocket support
apisix_timeout (multiline) Upstream timeout
additional_domain (multiline) Extra hosts for L7 route + TLS
max_body_size 10485760 client-control plugin (bytes)
route_all NEW true Route ALL ports (L7 + L4). apisix-image_base only

image_base Multi-Port Routing (L7 + L4)

When route_all: true is set on an apisix-image_base link, routes are generated for ALL ports defined on the image_base component.

L7 HTTP Routes
Port format: name:port:protocol
Example: http:8000:TCP
Generates: ApisixUpstream + ApisixRoute (spec.http) + ApisixTls
First HTTP port → {subdomain}.{domain}
Additional → {portname}-{subdomain}.{domain}
L4 Stream Routes
Port format: name:port:protocol:stream
Example: agent:50000:TCP:stream
Generates: ApisixUpstream + ApisixRoute (spec.stream)
Dedicated port on APISIX LB
No hostname / TLS needed
Example: image_base with ports
ports: |
  http:8000:TCP          → L7 route: myapp.stack-5.domain.io
  grpc:9090:TCP          → L7 route: grpc-myapp.stack-5.domain.io
  agent:50000:TCP:stream → L4 stream: ingressPort 50000
⚠ Important: L4 stream ports must be globally unique across all image_base links. Stream ports auto-enable service.stream in APISIX Helm values.

AI Gateway Sub-Component

Creates AI/LLM gateway routes with load balancing. Generates route/ai_gateway.yaml + route/ai_gateway_external.yaml.

ai_gateway-vllm
vLLM router service
{name}-router-service.{ns}:80
ai_gateway-model
vLLM model sub-component
{model}.{parent_ns}:80
ai_gateway-external_ai
External AI (OpenAI, etc.)
{ai_endpoint}:443

Gateway Sub-Component

Custom gateway routes to external_source_code backends. Generates route/gateway.yaml.

Link type: gateway-external_source_code
Variables: __gateway[] + __gateway_link[]