daemonset_update
Update container images in Kubernetes DaemonSets across clusters. Specify context, namespace, name, and new image to modify deployments.
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 | ||
| namespace | Yes | ||
| name | Yes | ||
| image | Yes |
Implementation Reference
- tools/daemonset.py:78-98 (handler)The daemonset_update tool handler: reads the existing DaemonSet, updates the first container's image, and replaces it using Kubernetes API.@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"}