I have several AWS EC2 instances, and on them I have a Rancher instance deployed. On Rancher, I've deployed a website using Kubernetes, and it is deployed using Istio to handle the networking, I am able to log in with http://portal.website.com:31380
. I also have AWS Route 53 to get the URL working and nginx for a load balancer across the EC2 instances.
But I want to be able to login with just http://portal.website.com
, so removing the port. Is there a way for me to do this?
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: portal-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ingress
spec:
hosts:
- "*"
gateways:
- portal-gateway
http:
- match:
- uri:
prefix: "/"
rewrite:
uri: "/"
route:
- destination:
host: portal
port:
number: 80
websocketUpgrade: true
---
apiVersion: v1
kind: Service
metadata:
name: portal
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8080
selector:
app: portal
type: ClusterIP
Edit: I am accessing this on 31380, because it is setup to use a NodePort (https://kubernetes.io/docs/concepts/services-networking/service/#nodeport). The Istio docs say 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.
Here is the output of kubectl get svc istio-ingressgateway -n istio-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istio-ingressgateway NodePort 10.43.200.101 15020:30051/TCP,80:31380/TCP,443:31390/TCP,31400:31400/TCP,15029:30419/TCP,15030:30306/TCP,15031:31130/TCP,15032:32720/TCP,15443:30361/TCP 3h27m
kubectl get svc istio-ingressgateway -n istio-system
? – Jakub