Error 503 - upstream connect error or disconnect/reset before headers. reset reason: connection failure

Hi,
I am using Istio version 1.6.0.
When i have deployed the “helloworld” from within the “samples” istio folder is work as expected.

Using similar configurations for the Gateway, VirtualService and the service, i have tried to deployed simple webapi (developed in VS2019) but it can’t be reached and keep getting 503 error.

I am trying to access it via: [istio-ingressgateway IP]/webapi
My webapi service called: “companyservices” and the following are the yaml configuration:


Service & Deployment:

apiVersion: v1
kind: Service
metadata:
name: companyservices
labels:
app: companyservices
spec:
ports:

  • port: 5000
    name: http
    selector:
    app: companyservices

apiVersion: apps/v1
kind: Deployment
metadata:
name: companyservices-v1
labels:
version: v1
spec:
replicas: 1
selector:
matchLabels:
app: companyservices
version: v1
template:
metadata:
labels:
app: companyservices
version: v1
spec:
containers:
- name: companyservices
image: nimicontainers.azurecr.io/companyservices:v1
resources:
requests:
cpu: “100m”
imagePullPolicy: IfNotPresent #Always
ports:
- containerPort: 5000


Gateway & VirtualService

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: companyservices-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:

  • port:
    number: 80
    name: http
    protocol: HTTP
    hosts:
    • “*”

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: companyservices
spec:
hosts:

  • “*”
    gateways:
  • companyservices-gateway
    #- istio-system/public-gateway
    http:
  • match:
    • uri:
      exact: /webapi
      route:
    • destination:
      host: companyservices
      port:
      number: 5000

I really need it to be accessed otherwise we won’t be able to work with Istio. Can someone please help ?

Thanks,
Nimrod

Hi @Nimrod_Rotner,

I think you are missing the Destination Rule.

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: your-destination-rule
spec:
  host: companyservices
  trafficPolicy:
    tls:
      mode: ISTIO_MUTUAL
  subsets:
    - name: yoursubset
      labels:
        version: v1