Service Enrty Overriding even if name is not same

I have two mongo which are externally deployed in another region of AWS and my application which is running into another region on self deployed Kubernetes by injecting ISTIO envoy sidecar.

To access that mongoDB from service mesh i created two serviceEnrty as given follows

====================ServiceEntry-1==========================
 apiVersion: networking.istio.io/v1alpha3

kind: ServiceEntry
metadata:
name: myapps-preprod-aws-self-manged-mongo-replica
spec:
hosts: - X.XX.XX.XXX
ports: -
number: 27017
name: tcp
protocol: TCP
resolution: DNS
location: MESH_EXTERNAL

=========================================

=======================serviceEntry-2==========================

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: oursapp-preprod-aws-self-manged-mongo-replica
spec:
hosts: - Y.YY.YY.YYY
ports: -
number: 27017
name: tcp
protocol: TCP
resolution: DNS
location: MESH_EXTERNAL

===========================================================

Even I tried to give MONGO protocol but No Luck.

please help me bit I am new in istio.

What are X.XX.XX.XXX and Y.YY.YY.YYY? Domain names or IP addresses? If they are IP addresses, you should add an addresses: stanza, and set the resolution to NONE.

Sir it is IP address

Thanks Sir, using following yaml config , I resolved. @spikecurtis

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: myapps-preprod-aws-self-manged-mongo-replica
spec:
hosts:

  • X.XX.XXX.XX
    ports:
  • number: 27017
    name: tcp
    protocol: TCP
    resolution: NONE
    addresses:
  • X.XX.XXX.XX
    location: MESH_EXTERNAL