ingress_get
Retrieve detailed information about a specific Kubernetes Ingress resource, including configuration and routing rules, to monitor and manage external access to services in your cluster.
Instructions
Get details of a specific Ingress.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name
Returns: Detailed information about the Ingress
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes | ||
| name | Yes |
Implementation Reference
- tools/ingress.py:72-99 (handler)The core handler function for the 'ingress_get' MCP tool. It fetches and returns detailed information (name, host, paths) about a specific Kubernetes Ingress resource in the given namespace using the NetworkingV1Api.@mcp.tool() @use_current_context def ingress_get(context_name: str, namespace: str, name: str): """ Get details of a specific Ingress. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name Returns: Detailed information about the Ingress """ networking_v1: NetworkingV1Api = get_api_clients(context_name)["networking"] ingress = networking_v1.read_namespaced_ingress(name=name, namespace=namespace) return { "name": ingress.metadata.name, "host": ingress.spec.rules[0].host if ingress.spec.rules else None, "paths": [ { "path": path.path, "service_name": path.backend.service.name, "service_port": path.backend.service.port.number } for path in ingress.spec.rules[0].http.paths ] if ingress.spec.rules else [] }