Skip to main content
Glama

replicaset_update

Update an existing ReplicaSet's container image and replica count in a specified Kubernetes namespace to modify application deployment configurations.

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
namespaceYes
nameYes
imageYes
replicasYes

Implementation Reference

  • The handler function for the 'replicaset_update' tool. It updates an existing ReplicaSet by changing the container image and the number of replicas using the Kubernetes AppsV1Api.
    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"}
  • Registers the 'replicaset_update' tool using the @mcp.tool() decorator from the MCP server.
    @mcp.tool()

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