Skip to main content
Glama

statefulset_create

Create a StatefulSet in a specified Kubernetes namespace using the k8s-pilot MCP server. Define context, namespace, image, replicas, and labels to manage deployment configurations.

Instructions

Create a StatefulSet in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name image: The container image to use replicas: Number of replicas labels: Labels to apply to the StatefulSet

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_nameYes
imageYes
labelsYes
nameYes
namespaceYes
replicasYes

Implementation Reference

  • The statefulset_create function decorated with @mcp.tool() implements and registers the MCP tool for creating a Kubernetes StatefulSet. It uses Kubernetes client to create the StatefulSet object and applies it to the specified namespace.
    @mcp.tool() @use_current_context @check_readonly_permission def statefulset_create(context_name: str, namespace: str, name: str, image: str, replicas: int, labels: dict): """ Create a StatefulSet in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The StatefulSet name image: The container image to use replicas: Number of replicas labels: Labels to apply to the StatefulSet Returns: Status of the creation operation """ apps_v1: AppsV1Api = get_api_clients(context_name)["apps"] statefulset = V1StatefulSet( metadata=V1ObjectMeta(name=name, labels=labels), spec=V1StatefulSetSpec( replicas=replicas, selector=V1LabelSelector(match_labels=labels), service_name=name, template=V1PodTemplateSpec( metadata=V1ObjectMeta(labels=labels), spec=V1PodSpec(containers=[V1Container(name=name, image=image)]) ) ) ) created_statefulset = apps_v1.create_namespaced_stateful_set(namespace=namespace, body=statefulset) return {"name": created_statefulset.metadata.name, "status": "Created"}
  • The @mcp.tool() decorator registers the statefulset_create 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