I have a TCP service. I created a TCP readiness probe for my service which appears to be working just fine.
Unfortunately, my EC2 target group wants to perform an HTTP health check on my instance. My service doesn't respond to HTTP requests, so my target group is considering my instance unhealthy.
Is there a way to change my target group's health check from "does it return an HTTP success response?" to "can a TCP socket be opened to it?"
(I'm also open to other ways of solving the problem if what I suggested above isn't possible or doesn't make sense.)
TCP is a valid protocol for health checks in 2 cases:
in case you're stuck with the Application Load Balancer - the only idea that comes to mind is to add a sidecar container that will respond to HTTP/HTTPS based on your TCP status. You could easily do this with nginx, although it would probably be quite an overkill.