I have set up a private service to run our Cloud SQL Proxy when deployed with Docker but it keeps refreshing connections from the local network. I tried the same setup using a web service and the same thing happened.
External connections work fine but this is not the expected behavior, we don’t have any other service running that is listening to this port, I even tried to change the port to something random, like 13370 in the example below, but the connection keeps refreshing.
Jan 12 12:38:50 PM 2023/01/12 15:38:50 Listening on 0.0.0.0:13370 for our_connection_instance
Jan 12 12:38:50 PM 2023/01/12 15:38:50 Ready for new connections
Jan 12 12:38:50 PM 2023/01/12 15:38:50 Generated RSA key in 66.655533ms
Jan 12 12:38:55 PM 2023/01/12 15:38:55 New connection for "our_connection_instance"
Jan 12 12:38:55 PM 2023/01/12 15:38:55 refreshing ephemeral certificate for instance our_connection_instance
Jan 12 12:38:55 PM 2023/01/12 15:38:55 Scheduling refresh of ephemeral certificate in 54m59s
Jan 12 12:38:55 PM 2023/01/12 15:38:55 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:00 PM 2023/01/12 15:39:00 New connection for "our_connection_instance"
Jan 12 12:39:00 PM Your service is live
Jan 12 12:39:00 PM 2023/01/12 15:39:00 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:05 PM 2023/01/12 15:39:05 New connection for "our_connection_instance"
Jan 12 12:39:05 PM 2023/01/12 15:39:05 New connection for "our_connection_instance"
Jan 12 12:39:05 PM 2023/01/12 15:39:05 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:05 PM 2023/01/12 15:39:05 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:10 PM 2023/01/12 15:39:10 New connection for "our_connection_instance"
Jan 12 12:39:10 PM 2023/01/12 15:39:10 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:15 PM 2023/01/12 15:39:15 New connection for "our_connection_instance"
Jan 12 12:39:15 PM 2023/01/12 15:39:15 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:20 PM 2023/01/12 15:39:20 New connection for "our_connection_instance"
Jan 12 12:39:20 PM 2023/01/12 15:39:20 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:25 PM 2023/01/12 15:39:25 New connection for "our_connection_instance"
Jan 12 12:39:25 PM 2023/01/12 15:39:25 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:30 PM 2023/01/12 15:39:30 New connection for "our_connection_instance"
Jan 12 12:39:30 PM 2023/01/12 15:39:30 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:35 PM 2023/01/12 15:39:35 New connection for "our_connection_instance"
Jan 12 12:39:35 PM 2023/01/12 15:39:35 New connection for "our_connection_instance"
Jan 12 12:39:35 PM 2023/01/12 15:39:35 Client closed local connection on 10.105.44.110:13370
Jan 12 12:39:35 PM 2023/01/12 15:39:35 Client closed local connection on 10.105.44.110:13370
The expected behavior is it starts like this then stop until a client connects:
Jan 12 12:38:50 PM 2023/01/12 15:38:50 Generated RSA key in 66.655533ms
Jan 12 12:38:55 PM 2023/01/12 15:38:55 New connection for "our_connection_instance"
Jan 12 12:38:55 PM 2023/01/12 15:38:55 refreshing ephemeral certificate for instance our_connection_instance