Page cover
For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to Create a New Persistent Volume Claim use CLI

A Persistent Volume Claim (PVC) is used to request storage resources from available Persistent Volumes in a Kubernetes cluster. Once created, the PVC can be used by applications and workloads that require persistent storage. This guide explains how to create a new Persistent Volume Claim using the Kubernetes Command Line Interface (CLI).

Download the preconfigured kubeconfig file from the Deka GPU by clicking the following link.

Install kubectl according to your operating system:

  • If you are using Windows, click the following link.

  • If you are using Linux, click the following link.

After the kubeconfig file and kubectl are available, create a YAML file for the Persistent Volume Claim by running the following command:

nano pvc.yaml

Add the following configuration to the pvc.yaml file, you can customize the name on line 4, storageClassName on line 7 with storage-mgmt, and the storage size on line 12.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: persistentvolumeclaim-o4il3
  namespace: default
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi

Review and modify the configuration as needed:

  • name: Specifies the name of the Persistent Volume Claim.

  • storageClassName: Specifies the StorageClass to be used.

  • storage: Specifies the requested storage capacity.

Save the file after completing the configuration.

Apply the configuration by running the following command:

Once the command is executed successfully, the Persistent Volume Claim will be created and become available for use within the Kubernetes cluster.

Last updated