Trying to Access OpenFaaS with an Istio Gateway

162 views Asked by At

I was trying to access OpenFaaS through istio in which I have included gateway and virtual service.

I need to create a separate endpoint for the OpenFaaS eg.: "http://istio_ingress_Loadbalancer/openfaas" - This should give me OpenFaaS UI.

Can anyone please help me, regarding I have hard time accessing this? Below is the code I have written for gateway and virtual service.

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: openfaas-gateway
spec:
  selector:
    istio: ingressgateway
  servers:
  - port: 
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: openfaas-vs
spec:
  hosts:
  - "*"
  gateways:
  - openfaas-gateway.openfaas.svc.cluster.local
  http:
  - match:
    - uri:
        prefix: /openfaas
    route:
    - destination:
        host: gateway.openfaas.svc.cluster.local
        port:
            number: 8080
1

There are 1 answers

0
Peter Claes On

Add the namespace property in your Gateway yaml file. Reference the gateway in your VirtualService yaml file with the following format : <gateway-namespace>/<gateway-name> https://istio.io/latest/docs/reference/config/networking/virtual-service/#VirtualService