istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/httpbin/README.md (about)

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