Skip to main content
Version: 1.8.0

Configuring Ingress with APISIX CRDs

This tutorial walks through configuring APISIX Ingress with APISIX Custom Resource Definitions (CRDs).

Also see:


Before you move on, make sure you:

  1. Have access to a Kubernetes cluster. This tutorial uses minikube.
  2. Install APISIX Ingress. See the Installation section.

Deploy httpbin#

We will deploy a sample service, kennethreitz/httpbin, for this tutorial.

You can deploy it to your Kubernetes cluster by running:

kubectl run httpbin --image kennethreitz/httpbin --port 80
kubectl expose pod httpbin --port 80

Configuring Ingress#

We can configure the Ingress using an ApisixRoute resource. The example below configures APISIX to route requests to the httpbin service:

kind: ApisixRoute
name: httpserver-route
- name: rule1
- /*
- serviceName: httpbin
servicePort: 80

This configuration will route all requests with host to the httpbin service.

You can apply it by running:

kubectl apply -f httpbin-ingress.yaml

Test the created Routes#

If you followed along and used minikube and NodePort service to expose APISIX, you can access it through the Node IP of the service apisix-gateway. If the Node IP is not reachable directly (if you are on Darwin, Windows, or WSL), you can create a tunnel to access the service on your machine:

minikube service apisix-gateway --url -n ingress-apisix

Now, you can send a GET request to the created Route and it will be Routed to the httpbin service:

curl --location --request GET "localhost:57687/get?foo1=bar1&foo2=bar2" -H "Host:"

You will receive a response similar to:

"args": {
"foo1": "bar1",
"foo2": "bar2"
"headers": {
"Accept": "*/*",
"Host": "",
"User-Agent": "curl/7.84.0",
"X-Forwarded-Host": ""
"origin": "",
"url": ""