Skip to main content
Glama

pv_create

Create PersistentVolumes in Kubernetes clusters to provide storage resources for applications, specifying capacity, access modes, and storage class.

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
context_nameYes
nameYes
capacityYes
access_modesYes
storage_classYes
host_pathYes

Implementation Reference

  • The handler function for the 'pv_create' tool. It creates a Kubernetes PersistentVolume with the specified parameters using the CoreV1Api.
    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-28 (registration)
    Decorators registering and configuring the 'pv_create' tool with MCP, context usage, and read-only permission check.
    @mcp.tool() @use_current_context @check_readonly_permission

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