How to expose custom ports on Istio ingress gateway

Peter Jausovec
7 min readAug 1, 2022

An interesting question popped up on one of my YouTube videos where I am explaining how to bring external traffic to the cluster using Istio and its ingress gateway.

The question (paraphrased) goes like this:

I’d like to expose two ports on the ingress gateway (e.g. 5000 and 3000) and use any host (e.g. “*”). Can I do this?

Practically, here’s what we want to happen. When a request is sent to GATEWAY_IP:3000 the response comes from one service within the cluster and when the request is sent to GATEWAY_IP:5000 the response will come from another service. The host stays the same (* in this case, but it could be any other hostname). The difference is in the port numbers.

Is it possible to do this?

The answer is YES and here are the high-level steps:

  1. Install Istio and expose additional ports through the ingress gateway service.
  2. Configure the Gateway resource to tell the Envoy proxy to listen to those ports.
  3. Create the VirtualService resource to route traffic to the services.
  4. Deploy the sample workload (httpbin).

Let’s get started.

Install Istio & expose additional ports