Hello all,
I would like to create a service entry for a specific dns entry. The goal is to use this dns name from inside the pods. For that reason I created a service entry:
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: my-service-entry
spec:
hosts:
- my-service-test
location: MESH_INTERNAL
ports:
- number: 8080
name: http
protocol: HTTP
resolution: DNS
endpoints:
- address: my-service.default.svc.cluster.local
If I execute a nslookup inside a pod, I am getting the following response:
nslookup my-service-test
my-service-test.default.svc.cluster.local canonical name = my-service-test
Name: my-service-test
Address: 240.240.0.2
According to the Istio documentation this is expected since the ip address is coming from the 240.240.0.0/16
ip address range.
So the dns resolution is working fine but I am not able to send a request. I am getting the error:
curl my-service-test:8080/test
upstream connect error or disconnect/reset before headers. reset reason: connection termination/
It’s working if I use the dns name of the service:
curl my-service.default.svc.cluster.local:8080/test
{"test":"test"}
I can see in the logs that the ip address of the service that should receive the request is getting resolved right:
{
authority: "my-service-test:8080"
bytes_received: 0
bytes_sent: 95
client_ip: null
downstream_local_address: "240.240.0.2:8080"
downstream_remote_address: "X.X.X.X:36638"
duration: 3
method: "GET"
path: "/test"
protocol: "HTTP/1.1"
requested_server_name: null
response_code: 503
response_code_details: "upstream_reset_before_response_started{connection_termination}"
response_flags: "UC"
route_name: "default"
upstream_cluster: "outbound|8080||my-service-test"
upstream_host: "Y.Y.Y.Y:8080"
upstream_local_address: "X.X.X.X:41590"
upstream_service_time: null
upstream_transport_failure_reason: null
user_agent: "curl/8.4.0"
x_forwarded_for: null
}
I increased the logs on the proxy but unfortunately I can’t see an error:
{
level: "debug"
msg: "[C201][***] upstream reset: reset reason: connection termination, transport failure reason: "
scope: "envoy router"
}
{
level: "debug"
msg: "[C201][***] Sending local reply with details upstream_reset_before_response_started{connection_termination}"
scope: "envoy http"
}
{
level: "debug"
msg: "[C201][***] encoding headers via codec (end_stream=false):
':status', '503'
'content-length', '95'
'content-type', 'text/plain'
'date', 'Wed, 15 Nov 2023 15:19:50 GMT'
'server', 'envoy'
"
scope: "envoy http"
}
Do you have any idea what the problem could be?