ingress_update
Update Kubernetes Ingress configurations to modify host routing and backend service connections for managing external access to applications.
Instructions
Update an existing Ingress in the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name host: The new host for the Ingress service_name: The new backend service name service_port: The new backend service port
Returns: Status of the update operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes | ||
| name | Yes | ||
| host | Yes | ||
| service_name | Yes | ||
| service_port | Yes |
Implementation Reference
- tools/ingress.py:105-126 (handler)The main handler function for the 'ingress_update' tool, which updates an existing Kubernetes Ingress resource by modifying its host, backend service name, and service port.def ingress_update(context_name: str, namespace: str, name: str, host: str, service_name: str, service_port: int): """ Update an existing Ingress in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The Ingress name host: The new host for the Ingress service_name: The new backend service name service_port: The new backend service port Returns: Status of the update operation """ networking_v1: NetworkingV1Api = get_api_clients(context_name)["networking"] ingress = networking_v1.read_namespaced_ingress(name=name, namespace=namespace) ingress.spec.rules[0].host = host ingress.spec.rules[0].http.paths[0].backend.service.name = service_name ingress.spec.rules[0].http.paths[0].backend.service.port.number = service_port updated_ingress = networking_v1.replace_namespaced_ingress(name=name, namespace=namespace, body=ingress) return {"name": updated_ingress.metadata.name, "status": "Updated"}
- tools/ingress.py:102-102 (registration)The @mcp.tool() decorator registers the ingress_update function as an MCP tool.@mcp.tool()