Skip to main content
Glama

pvc_create

Create PersistentVolumeClaims in Kubernetes namespaces using specified context, storage size, and access modes. Supports optional storage classes for dynamic provisioning.

Instructions

Create a PersistentVolumeClaim in the specified namespace.

Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The PersistentVolumeClaim name storage: The storage size (e.g., "10Gi") access_modes: List of access modes (e.g., ["ReadWriteOnce"]) storage_class: The storage class name (optional)

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_modesYes
context_nameYes
nameYes
namespaceYes
storageYes
storage_classNo

Implementation Reference

  • The pvc_create MCP tool handler: decorated with @mcp.tool() for registration, uses Kubernetes CoreV1Api to create a PersistentVolumeClaim (PVC) in the specified namespace with given storage, access modes, and optional storage class. Includes input validation via type hints and docstring schema description.
    @mcp.tool() @use_current_context @check_readonly_permission def pvc_create(context_name: str, namespace: str, name: str, storage: str, access_modes: list, storage_class: str = None): """ Create a PersistentVolumeClaim in the specified namespace. Args: context_name: The Kubernetes context name namespace: The Kubernetes namespace name: The PersistentVolumeClaim name storage: The storage size (e.g., "10Gi") access_modes: List of access modes (e.g., ["ReadWriteOnce"]) storage_class: The storage class name (optional) Returns: Status of the creation operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pvc = V1PersistentVolumeClaim( metadata=V1ObjectMeta(name=name), spec=V1PersistentVolumeClaimSpec( access_modes=access_modes, resources=V1ResourceRequirements(requests={"storage": storage}), storage_class_name=storage_class ) ) created_pvc = core_v1.create_namespaced_persistent_volume_claim(namespace=namespace, body=pvc) return {"name": created_pvc.metadata.name, "status": "Created"}

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