e4dc93dff36158b3c8e4fb06c3bacd92f47ff34c.svn-base 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Httpbin service
  2. This sample runs [httpbin](https://httpbin.org) as an Istio service.
  3. Httpbin is a well known HTTP testing service that can be used for experimenting
  4. with all kinds of Istio features.
  5. To use it:
  6. 1. Install Istio by following the [istio install instructions](https://istio.io/docs/setup/).
  7. 1. Start the httpbin service inside the Istio service mesh:
  8. If you have [automatic sidecar injection](https://istio.io/docs/setup/additional-setup/sidecar-injection/#automatic-sidecar-injection) enabled:
  9. ```bash
  10. kubectl apply -f httpbin.yaml
  11. ```
  12. Otherwise manually inject the sidecars before applying:
  13. ```bash
  14. kubectl apply -f <(istioctl kube-inject -f httpbin.yaml)
  15. ```
  16. Because the httpbin service is not exposed outside of the cluster
  17. you cannot _curl_ it directly, however you can verify that it is working correctly using
  18. a _curl_ command against `httpbin:8000` *from inside the cluster* using the public _dockerqa/curl_
  19. image from Docker hub:
  20. ```bash
  21. kubectl run -i --rm --restart=Never dummy --image=dockerqa/curl:ubuntu-trusty --command -- curl --silent httpbin:8000/html
  22. kubectl run -i --rm --restart=Never dummy --image=dockerqa/curl:ubuntu-trusty --command -- curl --silent --head httpbin:8000/status/500
  23. time kubectl run -i --rm --restart=Never dummy --image=dockerqa/curl:ubuntu-trusty --command -- curl --silent httpbin:8000/delay/5
  24. ```
  25. You can also test the httpbin service by starting the [sleep service](../sleep) and calling httpbin from it.
  26. A third option is to access the service from outside of the mesh through an Ingress Gateway.
  27. The [Ingress Gateways](https://istio.io/docs/tasks/traffic-management/ingress/ingress-control/) task explains how to do it.