Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
Simple http request between two pods using Istio

My frontend pod is trying to talk to my backend pod to fetch all the users in a DB. The call is straightforward and works when I use curl inside BOTH the frontend and istio-proxy containers in the frontend pod:

kubectl exec -it frontend-pod -c frontend-container -- bash
curl backend-svc:8000/users/
# returns correct response

kubectl exec -it frontend-pod -c istio-proxy -- bash
curl backend-svc:8000/users/
# returns correct response

However, my frontend react app is having trouble hitting this endpoint in Chrome. Here are the console logs:

GET http://backend-svc:8000/users/ net::ERR_NAME_NOT_RESOLVED

Looks like the domain name cannot be resolved. Any idea what I'm doing wrong here?

I'm using nginx to serve my frontend react application (not sure if that may be a problem).

EDIT: Some feedback says I need to adjust my Gateway and/or Virtual service files. Here's what they look like now:

# Source: myapp/gateway.yaml
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: myapp-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
        - '*'
---
# Source: myapp/virtual-service.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: myapp
spec:
  hosts:
    - '*'
  gateways:
    - myapp-gateway
  http:
    - route:
        - destination:
            host: frontend-svc
            port:
              number: 80
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Couple of things look wrong in your code samples:

  1. Your Istio VirtualService Routes does not match the request. Correct format would look like this:

apiVersion: networking.istio.io/v1alpha3
    kind: VirtualService
    metadata:
      name: bookinfo
    spec:
      hosts:
      - "*"
      gateways:
      - bookinfo-gateway
      http:
      - match:
        - uri:
            exact: /frontend
        route:
        - destination:
            host: frontend-svc
            port:
              number: 80

  1. In the same VirtualService you require a route for the backend.
  2. You have to amend your frontend code to call the Gateway backend URL. This URL needs to include the external IP or Domain name of your Gateway as well as the external HTTP port.

A good resource to piece these things together is the Istio Getting Started Page

over 4 years ago · Santiago Trujillo Relatório

0

Just to make sure: is your call triggered on the client side? If yes, that's the reason, since http://backend-svc:8000/users/ are DNS entries that are issued by core components and that are available only internally in the cluster.

That being said you should create a Gateway Custom Resource. The full description is here

A Gateway allows Istio features such as monitoring and route rules to be applied to traffic entering the cluster.

Hope I helped.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda