replicaset_list
List all ReplicaSets in a specified Kubernetes namespace to monitor and manage application deployments across clusters using the k8s-pilot server.
Instructions
List all ReplicaSets in a given namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace
Returns: List of ReplicaSet basic information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/replicaset.py:8-24 (handler)Handler function for the 'replicaset_list' tool. Lists ReplicaSets in a namespace using Kubernetes AppsV1Api, decorated with @mcp.tool() for registration.@mcp.tool() @use_current_context def replicaset_list(context_name: str, namespace: str): """ List all ReplicaSets in a given namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace Returns: List of ReplicaSet basic information """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] replicasets = apps_v1.list_namespaced_replica_set(namespace) result = [{"name": rs.metadata.name, "replicas": rs.status.replicas} for rs in replicasets.items] return result