ingress_update
Update an existing Kubernetes Ingress resource by specifying the context, namespace, Ingress name, host, backend service name, and port. Returns the status of the update operation.
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 | ||
| host | Yes | ||
| name | Yes | ||
| namespace | Yes | ||
| service_name | Yes | ||
| service_port | Yes |
Implementation Reference
- tools/ingress.py:102-126 (handler)The handler function for the 'ingress_update' MCP tool. It reads an existing Kubernetes Ingress, updates its host, backend service name, and port, then replaces it using the Kubernetes API.@mcp.tool() @use_current_context @check_readonly_permission 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"}