When a service is defined without a selector, or with a selector that does not match any pods, then there will not be any endpoints created for that service. This is an issue when that service is expected to actually send traffic to pods. Double-check the service configuration to make sure the selector is defined correctly, or manually create the endpoints for the service.
The Blue Matador agent will periodically iterate through every endpoint of every service and attempt to connect over each port defined in the service. This check can expose a variety of issues:
If the port of an endpoint for a service is not reachable, the service is considered unhealthy.
To debug an unhealthy service, perform the following checks:
To ensure that a service does not contain endpoints for containers that do not listen on the expected port, you can define a readiness probe in the container spec. When the container does not match the conditions for the readiness probe, its pod will be removed as a target by the service.