ApisixRoute is a CRD resource which focus on how to route traffic to
expected backend, it exposes many features supported by Apache APISIX.
Compared to Ingress,
functions are implemented in a more native way, with stronger semantics.
URI path are always used to split traffic, for instance, requests with host
/foo prefix should be routed to service
foo while requests which path is
should be routed to service
bar, in the manner of
ApisixRoute, the configuration
There are two path types can be used,
exact, default is
prefix is desired, just append a
*, for instance,
all paths with the prefix of
Path based route are most common, but if it's not enough, try
other route features in
ApisixRoute such as
methods splits traffic according to the HTTP method, the following configurations routes requests
GET method to
foo service (a Kubernetes Service).
exprs allows user to configure match conditions with arbitrary predicates in HTTP, such as queries, HTTP headers, Cookie.
It's composed by several expressions, which in turn composed by subject, operator and value/set.
The above configuration configures an extra route match condition, which asks the
id must be equal to
By default a referenced Service will be watched, so
it's newest endpoints list can be updated to Apache APISIX.
apisix-ingress-controller provides another mechanism that just use
ClusterIP of this service, if that's what you want, just set
service (default is
There can more than one backend specified in one route rule,
when multiple backends co-exist there, the traffic split based on weights
will be applied (which actually uses the traffic-split plugin in Apache APISIX).
You can specify weight for each backend, the default weight is
ApisixRoute has one route rule, which contains two backends
bar, the weight ratio is
2/3 requests (with
GET method and
User-Agent matching regex pattern
.*Chrome.*) will be sent to service
will be proxied to serivce
Apache APISIX provides more than 40 plugins, which can be used
ApisixRoute. All configuration items are named same to the one in APISIX.
The above configuration enables Cors plugin for requests
which host is
Websocket service can be proxied
by creating a route with specifying the
apisix-ingress-controller supports the port-based tcp route.
The above yaml configuration guides TCP traffic entered to the Ingress proxy server (i.e. APISIX) port
9100 should be routed to the backend service
Note since APISIX doesn't support dynamic listening, so here the
9100 port should be pre-defined in APISIX configuration.