Skip to main content
Glama

ingress_create

Create and manage Kubernetes Ingress resources in specified namespaces with context-aware configuration, enabling traffic routing to backend services via host and port settings.

Instructions

Create an Ingress in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name host: The host for the Ingress service_name: The backend service name service_port: The backend service port

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
hostYes
nameYes
namespaceYes
service_nameYes
service_portYes

Implementation Reference

  • The main handler function for the 'ingress_create' MCP tool. It creates a Kubernetes Ingress resource with the specified host, service, and port, decorated with @mcp.tool() for registration, @use_current_context for context management, and @check_readonly_permission for permissions.
    @mcp.tool() @use_current_context @check_readonly_permission def ingress_create(context_name: str, namespace: str, name: str, host: str, service_name: str, service_port: int): """ Create an Ingress in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name host: The host for the Ingress service_name: The backend service name service_port: The backend service port Returns: Status of the creation operation """ networking_v1: NetworkingV1Api = get_api_clients(context_name)["networking"] ingress = V1Ingress( metadata=V1ObjectMeta(name=name), spec=V1IngressSpec( rules=[ V1IngressRule( host=host, http=V1HTTPIngressRuleValue( paths=[ V1HTTPIngressPath( path="/", path_type="Prefix", backend=V1IngressBackend( service={"name": service_name, "port": {"number": service_port}} ) ) ] ) ) ] ) ) created_ingress = networking_v1.create_namespaced_ingress(namespace=namespace, body=ingress) return {"name": created_ingress.metadata.name, "status": "Created"}
  • tools/ingress.py:28-28 (registration)
    The @mcp.tool() decorator registers the ingress_create function as an MCP tool.
    @mcp.tool()
  • Function signature with type hints and docstring defining input parameters and output for the ingress_create tool schema.
    def ingress_create(context_name: str, namespace: str, name: str, host: str, service_name: str, service_port: int): """ Create an Ingress in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name host: The host for the Ingress service_name: The backend service name service_port: The backend service port Returns: Status of the creation operation """

Other Tools

Related Tools

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