Skip to main content
Glama

pv_create

Creates a PersistentVolume in a Kubernetes cluster by specifying context, name, capacity, access modes, storage class, and host path for efficient storage management.

Instructions

Create a PersistentVolume in the cluster.

Args: context_name: The Kubernetes context name name: The PersistentVolume name capacity: The storage capacity (e.g., "10Gi") access_modes: List of access modes (e.g., ["ReadWriteOnce"]) storage_class: The storage class name host_path: The host path for the volume

Returns: Status of the creation operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
access_modesYes
capacityYes
context_nameYes
host_pathYes
nameYes
storage_classYes

Implementation Reference

  • The pv_create tool handler: creates a PersistentVolume in Kubernetes cluster using the CoreV1Api. Registered via @mcp.tool() decorator.
    @mcp.tool() @use_current_context @check_readonly_permission def pv_create(context_name: str, name: str, capacity: str, access_modes: list, storage_class: str, host_path: str): """ Create a PersistentVolume in the cluster. Args: context_name: The Kubernetes context name name: The PersistentVolume name capacity: The storage capacity (e.g., "10Gi") access_modes: List of access modes (e.g., ["ReadWriteOnce"]) storage_class: The storage class name host_path: The host path for the volume Returns: Status of the creation operation """ core_v1: CoreV1Api = get_api_clients(context_name)["core"] pv = V1PersistentVolume( metadata=V1ObjectMeta(name=name), spec=V1PersistentVolumeSpec( capacity={"storage": capacity}, access_modes=access_modes, storage_class_name=storage_class, host_path={"path": host_path} ) ) created_pv = core_v1.create_persistent_volume(body=pv) return {"name": created_pv.metadata.name, "status": "Created"}
  • tools/pv.py:26-26 (registration)
    Registration of the pv_create tool using the @mcp.tool() decorator.
    @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