Skip to main content
Glama

replicaset_update

Update a Kubernetes ReplicaSet by specifying the namespace, name, container image, and replica count using the MCP server k8s-pilot. Manage cluster resources efficiently.

Instructions

Update an existing ReplicaSet in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ReplicaSet name image: The new container image to update replicas: The new number of replicas

Returns: Status of the update operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
imageYes
nameYes
namespaceYes
replicasYes

Implementation Reference

  • The main handler function for the 'replicaset_update' tool, decorated with @mcp.tool() for registration, @use_current_context for context management, and @check_readonly_permission for permissions. It updates the image and replicas of a ReplicaSet using Kubernetes AppsV1Api.
    @mcp.tool() @use_current_context @check_readonly_permission def replicaset_update(context_name: str, namespace: str, name: str, image: str, replicas: int): """ Update an existing ReplicaSet in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The ReplicaSet name image: The new container image to update replicas: The new number of replicas Returns: Status of the update operation """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] replicaset = apps_v1.read_namespaced_replica_set(name=name, namespace=namespace) replicaset.spec.template.spec.containers[0].image = image replicaset.spec.replicas = replicas updated_replicaset = apps_v1.replace_namespaced_replica_set(name=name, namespace=namespace, body=replicaset) return {"name": updated_replicaset.metadata.name, "status": "Updated"}
  • The @mcp.tool() decorator registers the replicaset_update function as an MCP tool.
    @mcp.tool()

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