Hello fellow gophers!
I'm relatively new to Go, and found some nice opportunity to try it out for some k8s cronjobs.
Problem is that when running inside k8s (more specifically, AWS eks), all requests from HTTP client (using default one) are erroring with the same error: read tcp {ip}:{port}->{ip}:{port}: read: connection reset by peer.
Locally everything works fine, also in docker and also in locally created k8s cluster. Also, curl from the same pod in AWS to the same URL works fine!
After further debugging it seems that problem arrises when http client is trying to do TLS handshake.
I've searched for this problem a LOT, but unfortunatelly no luck, nor docs. A bit shame for golang for this. I've also tried to call the same url with the C# code (native http client from .net) and it worked well within same environment.
Can some of you help me with that? Thanks in advance!
Edit: Some further info for debug:
- Tried with
alpineandgrc.io/distroless/static-debian12docker images - Using default Go
http.Client{} - Any other tools work fine with the same URL (tried curl, telnet, c# client...)