--- title: Enabling Ingress Traffic overview: Describes how to configure Istio to expose a service outside of the service mesh. order: 30 layout: docs type: markdown --- This task describes how to configure Istio to expose a service outside of the service mesh cluster. In a Kubernetes environment, Istio uses [Kubernetes Ingress Resources](https://kubernetes.io/docs/concepts/services-networking/ingress/) to configure ingress behavior. ## Before you begin * Setup Istio by following the instructions in the [Installation guide](./installing-istio.html). * Start the [httpbin](https://github.com/istio/istio/tree/master/demos/apps/httpbin) sample, which will be used as the destination service to be exposed externally. ## Configuring ingress (HTTP) 1. Create the Ingress Resource for the httpbin service ```bash cat < 80:31486/TCP,443:32254/TCP 32m ``` ```bash export INGRESS_URL=169.47.243.100:31486 ``` 1. Access the httpbin service using _curl_: ```bash curl http://$INGRESS_URL/headers ``` ``` { "headers": { ... ``` ## Configuring secure ingress (HTTPS) 1. Generate keys if necessary A private key and certificate can be created for testing using [OpenSSL](https://www.openssl.org/). ```bash openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls.key -out /tmp/tls.crt -subj "/CN=foo.bar.com" ``` 1. Create the secret using `kubectl` ```bash kubectl create secret tls ingress-secret --key /tmp/tls.key --cert /tmp/tls.crt ``` 1. Create the Ingress Resource for the httpbin service ```bash cat < 80:31486/TCP,443:32254/TCP 32m ``` ```bash export SECURE_INGRESS_URL=169.47.243.100:32254 ``` 1. Access the secured httpbin service using _curl_: ```bash curl -k https://$SECURE_INGRESS_URL/html ``` ``` ... ``` ## Setting Istio rules on an edge service Similar to inter-cluster requests, Istio [routing rules]({{home}}/docs/concepts/traffic-management/rules-configuration.html) can also be set for edge services that are called from outside the cluster. To illustrate we will use [istioctl]({{home}}/docs/reference/commands/istioctl.html) to set a timeout rule on calls to the httpbin service. 1. Invoke the httpbin `/delay` endpoint you exposed previously: ```bash time curl http://$INGRESS_URL/delay/5 ``` ``` ... real 0m5.024s user 0m0.003s sys 0m0.003s ``` The request should return in approximately 5 seconds. 1. Use `istioctl` to set a 3s timeout on calls to the httpbin service ```bash cat <