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

     1  # Simple sleep service
     2  
     3  This sample consists of a simple service that does nothing but sleep.
     4  It's a ubuntu container with curl installed that can be used as a request source for invoking other services
     5  to experiment with Istio networking.
     6  
     7  To use it:
     8  
     9  1. Install Istio by following the [istio install instructions](https://istio.io/docs/setup/).
    10  
    11  1. Start the sleep service:
    12  
    13      If you have [automatic sidecar injection](https://istio.io/docs/setup/additional-setup/sidecar-injection/#automatic-sidecar-injection) enabled:
    14  
    15      ```bash
    16      kubectl apply -f sleep.yaml
    17      ```
    18  
    19      Otherwise manually inject the sidecars before applying:
    20  
    21      ```bash
    22      kubectl apply -f <(istioctl kube-inject -f sleep.yaml)
    23      ```
    24  
    25  1. Start some other services, for example, the [Bookinfo sample](https://istio.io/docs/examples/bookinfo/).
    26  
    27      Now you can `kubectl exec` into the sleep service to experiment with Istio networking.
    28      For example, the following commands can be used to call the Bookinfo `ratings` service:
    29  
    30      ```bash
    31      export SLEEP_POD=$(kubectl get pod -l app=sleep -o jsonpath={.items..metadata.name})
    32      kubectl exec -it $SLEEP_POD -c sleep -- curl http://ratings.default.svc.cluster.local:9080/ratings/1
    33      {"id":1,"ratings":{"Reviewer1":5,"Reviewer2":4}}
    34      ```
    35  
    36  You can also use the sleep service to test accessing services outside of the mesh.
    37  See [configuring egress](https://istio.io/docs/tasks/traffic-management/egress/) for details.