Access external endpoints based on istio ServiceEntry name?

1/16/2022

I am currently checking whether we can able to connect the external endpoint based on the serviceentry name to allow us to easily switch the hosts configured in the serviceentry. Below is the current config I am using and also enabled ISTIO_META_DNS_CAPTURE: "true" in the istio config

---
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
  name: elasticsearch-cluster-dev
spec:
  exportTo:
  - .
  hosts:
  - dev-elastic.es.europe-west1.gcp.cloud.es.io
  location: MESH_EXTERNAL
  ports:
  - name: https
    number: 443
    protocol: TLS
  resolution: DNS

But the connection request to elasticsearch-cluster-dev returns Could not resolve host

root@nginx:/# curl https://elasticsearch-cluster-dev
curl: (6) Could not resolve host: elasticsearch-cluster-dev
root@nginx:/# 

Can we able to connect to an external endpoint based on the ServiceEntry name in istio? Am i missing any istio config?

-- SimbuStar
external
istio
istio-operator
istio-sidecar
kubernetes

0 Answers