Retrieves a list of ServiceSummary objects for services in a given namespace or all namespaces.
Similar to kubectl get services
.
Parameters
----------
namespace : Optional[str], default=None
The specific namespace to list services from. If None, lists services from all namespaces.
Returns
-------
list of ServiceSummary
A list of ServiceSummary objects, each providing a summary of a service's status with the following fields:
name : str
Name of the service.
namespace : str
Namespace in which the service is running.
type : str
Type of the service (ClusterIP, NodePort, LoadBalancer, ExternalName).
cluster_ip : Optional[str]
Cluster IP address assigned to the service (None for ExternalName services).
external_ip : Optional[str]
External IP address if applicable (for LoadBalancer services).
ports : list[PortInfo]
List of ports (and their protocols) exposed by the service.
age : datetime.timedelta
Age of the service (current time minus creation timestamp).
Raises
------
K8sConfigError
If unable to initialize the K8S API.
K8sApiError
If the API call to list services fails.