configmap_update
Update existing ConfigMaps in Kubernetes namespaces to modify configuration data for applications and services.
Instructions
Update an existing ConfigMap in the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ConfigMap name data: The new data to update in the ConfigMap
Returns: Status of the update operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| namespace | Yes | ||
| name | Yes | ||
| data | Yes |
Implementation Reference
- tools/configmap.py:73-93 (handler)The core handler implementation for the 'configmap_update' tool. It reads the existing ConfigMap, updates its data, and replaces it using the Kubernetes CoreV1Api. Decorated with @mcp.tool() for registration and other utilities.@mcp.tool() @use_current_context @check_readonly_permission def configmap_update(context_name: str, namespace: str, name: str, data: dict): """ Update an existing ConfigMap in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ConfigMap name data: The new data to update in the ConfigMap Returns: Status of the update operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] configmap = core_v1.read_namespaced_config_map(name=name, namespace=namespace) configmap.data = data updated_configmap = core_v1.replace_namespaced_config_map(name=name, namespace=namespace, body=configmap) return {"name": updated_configmap.metadata.name, "status": "Updated"}
- tools/configmap.py:73-73 (registration)The @mcp.tool() decorator registers the configmap_update function as an MCP tool.@mcp.tool()