Skip to main content
Glama

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
NameRequiredDescriptionDefault
context_nameYes
namespaceYes
nameYes

Implementation Reference

  • 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 []
        }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bourbonkk/k8s-pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server