Getting unknown host when redirecting HTTP request to a service entry via virtual service

12/13/2019

I am trying to configure an application's HTTP requests to a URL to be redirected to an external service. However I am getting an unknown host error.

In my application I have configured the url to be:

https://httpbin.external/uuid

I have the following virtual service and service entry configurations

---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: httpbin
spec:
  hosts:
  - "httpbin.external"
  http:
  - route:
    - destination:
        host: httpbin.org
        port:
          number: 443
---
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  name: httpbin
spec:
  hosts:
  - "httpbin.org"
  ports:
  - number: 443
    name: https
    protocol: HTTPS
  - number: 80
    name: http
    protocol: HTTP
  resolution: DNS
  location: MESH_EXTERNAL

I am getting the following error:

I/O error on GET request for "https://httpbin.external/uuid": httpbin.external; nested exception is java.net.UnknownHostException: httpbin.external

-- Chad
istio
kubernetes

0 Answers