pub async fn get_endpoint(
client: &Client,
namespace: &str,
service_name: &str,
port_name: &str,
) -> Result<Vec<EndpointAddress>>Expand description
Get all ready endpoints for a service.
Queries the Kubernetes Endpoints API to find all ready pod IPs and ports for a given service. The port_name must match the name field in the service’s port specification.
§Arguments
client- Kubernetes API clientnamespace- Namespace of the serviceservice_name- Name of the service (usually same as instance name)port_name- Name of the port to query (e.g., “rndc-api”, “dns-tcp”)
§Returns
Vector of endpoint addresses with IP and port
§Errors
Returns an error if:
- Failed to get endpoints from API
- No ready addresses found