Proxy the httpbin service
This document explains how apisix-ingress-controller guides Apache APISIX routes traffic to httpbin service correctly.
Prerequisites#
- Prepare an available Kubernetes cluster in your workstation, we recommend you to use Minikube.
- Install Apache APISIX in Kubernetes by Helm Chart.
- Install apisix-ingress-controller.
Deploy httpbin service#
We use kennethreitz/httpbin as the service image, See its overview page for details.
Now, try to deploy it to your Kubernetes cluster:
Resource Delivery#
In order to let Apache APISIX proxies requests to httpbin, we need to create an ApisixRoute resource, if you're not familiar with it, see the reference for the details.
The YAML snippet shows a simple ApisixRoute configuration, which tells Apache APISIX to route all requests with Host local.httpbin.org to the httpbin service.
Now try to create it.
Test#
Run curl call in one of Apache APISIX Pods to check whether the resource was delivered to it. Note you should replace the value of --apisix-admin-key to the real admin_key value in your Apache APISIX cluster.
And request to Apache APISIX to verify the route.
In case of success, you'll see a JSON string which contains all requests headers carried by curl like: