One day I found my pod can’t connect MySQL, I test curl IP:3306 which return
upstream connect error or disconnect/reset before headers. reset reason: connection termination
meanwhile mysql -h IP:3306 returns nothing but hanging
After some troubleshooting, I found it caused by a Kubernetes service which port is 3306 and portname is http-3306. and this will create A 0.0.0.0_3306 HTTP listener in the envoy.
I understand that
the services cannot use the same port number for different protocols
but did not know this will decline all TCP traffic.
My question is if there is HTTP service using 3306 port, how can I connect to my MySQL service. either Can I restrict this service only affect itself namespace but not all like virtualservice config “exportTo .”