Score:1

istio gateway, not loading the node application

ke flag

I have tried to deploy a sample nginx app and it working. So, I replaced the same with another nodejs as this contains mutliple sub pages. So, I can test the routing.

Here, with LoadBalancer default service type, the page is loading as below.

LB

But, with istio gateway, it is just showing an empty page.

gateway

Please suggest how to fix that?

My gateway:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: sampleserver-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"

My virtualservice:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: nginxserver
spec:
  hosts:
  - "*"
  gateways:
  - sampleserver-gateway
  http:
  - match:
    - uri:
        exact: /
    route:
    - destination:
        host: nginx-service
        port:
          number: 8080

My deployment and service file:

apiVersion: v1
kind: Service
metadata:
  name: nginx-service
  labels:
    app: nginx
    service: nginx
spec:
  selector:
    app: nginx
  ports:
    - name: http 
      port: 8080
      targetPort: 3000 #80

---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: nginx-details
  labels:
    account: nginx
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
      version: v1
  template:
    metadata:
      labels:
        app: nginx
        version: v1
    spec:
      serviceAccountName: nginx-details
      containers:
        - name: nginx
          image: uday1kiran/getting-started:1.0 #nginx
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3000 #80
              name: nginx-port
          #securityContext:
              #runAsUser: 1000

For gateway, I set the default kubernetes service as ClusterIP. But, as it is not showing, for testing purpose I changed it to LoadBalancer to check any issue with app, but throug normal LoadBalancer service it is loading but not with istio ingresss gateway.

The sample app is public image, you can test directly

The source code of application is in app folder of repo

uday avatar
ke flag
First image is load balancer service ip. second image is ingress gateway ip. As this is deployed in AKS, i got public ips from microsoft
uday avatar
ke flag
Any suggestions on this? I guess internally it is not allowing any page rendering, here in this case it is a react app, which is not getting loaded back.
uday avatar
ke flag
There is no reply from the istio discussion forum also : https://discuss.istio.io/t/istio-gateway-not-loading-the-node-application/10945
Mikołaj Głodziak avatar
id flag
Are you using Consul or Istio? Additionally, have you tried changing http match from "exact" to "prefix"? Also, could you provide the definition of service type Loadbalancer and target ports for both service definitions?
uday avatar
ke flag
We are using consul for one product in a different cluster and for a different project. And using istio for one product. And have changed to prefix but still not loading. The source code of this test app is available in the link I posted in the last line.
Mikołaj Głodziak avatar
id flag
The link with the source code is not working, it's redirecting to "about:blank#blocked".
Score:0
jp flag

I've reproduced your issue and everything works fine after changing http match from "exact" to "prefix" in the virtualservice, here is the proof: enter image description here

enter image description here

enter image description here

Wytrzymały Wiktor avatar
it flag
Hello @uday. Any progress?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.