daemonset_update
Update DaemonSets in Kubernetes clusters by specifying namespace, context, and desired container image. Returns the operation status for tracking changes.
Instructions
Update an existing DaemonSet in the specified namespace.
Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The DaemonSet name image: The new container image to update
Returns: Status of the update operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context_name | Yes | ||
| image | Yes | ||
| name | Yes | ||
| namespace | Yes |
Implementation Reference
- tools/daemonset.py:78-98 (handler)The daemonset_update tool handler: reads the existing DaemonSet, updates its first container's image, and replaces it using the Kubernetes AppsV1Api.@mcp.tool() @use_current_context @check_readonly_permission def daemonset_update(context_name: str, namespace: str, name: str, image: str): """ Update an existing DaemonSet in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The DaemonSet name image: The new container image to update Returns: Status of the update operation """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] daemonset = apps_v1.read_namespaced_daemon_set(name=name, namespace=namespace) daemonset.spec.template.spec.containers[0].image = image updated_daemonset = apps_v1.replace_namespaced_daemon_set(name=name, namespace=namespace, body=daemonset) return {"name": updated_daemonset.metadata.name, "status": "Updated"}
- tools/daemonset.py:78-78 (registration)Registration of the daemonset_update tool using the @mcp.tool() decorator.@mcp.tool()