Skip to main content

Manage PVCs with the CLI

Create, list, get, and delete Persistent Volume Claims using the v8x

Manage PVCs with the CLI

Manage Persistent Volume Claims on a Kubernetes cluster from the command line.

TimeAbout 5 minutes
You will needv8x installed and authenticated, a Kubernetes cluster with a storage class configured
OutcomeA PVC created, inspected, and cleaned up via the CLI

The uvx v8x storage command group provides PVC CRUD operations. The namespace defaults to your username (derived from your login email) but can be overridden with --namespace.

Inspect the storage commands

If this is your first time using the storage commands, start with:

uvx v8x storage --help
uvx v8x storage create --help

The core workflow is:

  • uvx v8x storage create to provision a new PVC
  • uvx v8x storage list to see PVCs in a namespace
  • uvx v8x storage get to inspect a specific PVC
  • uvx v8x storage delete to remove a PVC
  • uvx v8x storage list-available to discover storage classes

Create a PVC

Provision a new Persistent Volume Claim:

# Creates in your user namespace (derived from login email)
uvx v8x storage create my-data my-cluster --size 50Gi

# Override with a specific namespace, storage class, or access mode
uvx v8x storage create my-data my-cluster --size 100Gi \
--namespace custom-ns --storage-class ceph-block --access-mode ReadWriteMany

Key options:

  • CLUSTER_NAME (required, positional) - the target Kubernetes cluster
  • --size (required) - capacity with unit suffix (Ki, Mi, Gi, Ti)
  • --namespace - the Kubernetes namespace (defaults to your username)
  • --storage-class - the storage class to use (defaults to the cluster default)
  • --access-mode - one of ReadWriteOnce, ReadOnlyMany, ReadWriteMany, ReadWriteOncePod

Success looks like this: the command returns the new PVC details including its name, namespace, size, and initial status.

List PVCs

See all PVCs in a namespace:

# Lists PVCs in your user namespace
uvx v8x storage list my-cluster

# Override with a specific namespace
uvx v8x storage list my-cluster --namespace custom-ns

Success looks like this: a table of PVCs showing their name, namespace, size, status, and storage class.

Get PVC details

Inspect a specific PVC:

# Gets PVC from your user namespace
uvx v8x storage get my-data my-cluster

# Override with a specific namespace
uvx v8x storage get my-data my-cluster --namespace custom-ns

Success looks like this: full details of the PVC including capacity, access modes, volume name, and current phase.

Delete a PVC

Remove a PVC you no longer need:

# Deletes PVC from your user namespace
uvx v8x storage delete my-data my-cluster

# Override with a specific namespace
uvx v8x storage delete my-data my-cluster --namespace custom-ns

# Skip the confirmation prompt
uvx v8x storage delete my-data my-cluster --force

Success looks like this: the PVC is removed from the namespace. Subsequent list commands no longer show it.

List available storage classes

Discover which storage classes are available on your cluster:

uvx v8x storage list-available my-cluster

Success looks like this: a list of storage classes with their provisioner, reclaim policy, and other metadata.

Ask AI
Ask a question about Vantage Compute...