Skip to main content
Glama

configmap_update

Modify Kubernetes ConfigMap data within a specified namespace using context-specific inputs. Ensures accurate updates to configuration settings across clusters managed by k8s-pilot MCP server.

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

Implementation Reference

  • The handler function for the 'configmap_update' tool. It reads an existing ConfigMap, updates its data field with the provided dictionary, and replaces it in the Kubernetes cluster using the CoreV1Api. Decorated with @mcp.tool() for registration, @use_current_context to set the context, and @check_readonly_permission for access control.
    @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"}

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