hubert
hubert

Reputation: 3177

expose Istio-gateway on port 80

I'm running a bare metal Kubernetes cluster with 1 master node and 3 worker Nodes. I have a bunch of services deployed inside with Istio as an Ingress-gateway.

Everything works fine since I can access my services from outside using the ingress-gateway NodePort.

NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                      AGE
istio-ingressgateway   LoadBalancer   10.106.9.2       <pending>     15021:32402/TCP,80:31106/TCP,443:31791/TCP   2d23h
istiod                 ClusterIP      10.107.220.130   <none>        15010/TCP,15012/TCP,443/TCP,15014/TCP        2d23h

In our case the port 31106.

The issues is, I don't want my customer to access my service on port 31106. that's not user friendly. So is there a way to expose the port 80 to the outside ?

In other word, instead of typing http://example.com:31106/ , I want them to be able to type http://example.com/

Any solution could help.

Upvotes: 1

Views: 1748

Answers (1)

Mikołaj Głodziak
Mikołaj Głodziak

Reputation: 5277

Based on official documentation:

If the EXTERNAL-IP value is set, your environment has an external load balancer that you can use for the ingress gateway. If the EXTERNAL-IP value is <none> (or perpetually <pending>), your environment does not provide an external load balancer for the ingress gateway. In this case, you can access the gateway using the service’s node port.

This is in line with what David Maze wrote in the comment:

A LoadBalancer-type service would create that load balancer, but only if Kubernetes knows how; maybe look up metallb for an implementation of that. The NodePort port number will be stable unless the service gets deleted and recreated, which in this case would mean wholesale uninstalling and reinstalling Istio.

In your situation you need to access the gateway using the NodePort. Then you can configure istio. Everything is described step by step in this doc. You need to choose the instructions corresponding to NodePort and then set the ingress IP depends on the cluster provider. You can also find sample yaml files in the documentation.

Upvotes: 1

Related Questions