kubectl-pvc-explorer
A kubectl plugin for browsing and managing PVC contents via the pvc-explorer operator.
Use your existing kubeconfig for authentication — no extra login or credentials required.
shell
kubectl pvc list
kubectl pvc ls my-pvc -n my-namespace /data/logs
kubectl pvc cp my-pvc:/remote/file.txt ./local-file.txtRelationship to the Operator
The CLI plugin communicates with the PVC Explorer operator installed in your cluster:
kubectl pvc
CLI plugin
kubeconfig
pvc-explorer
Operator
proxies
pvc-explorer-agent
Agent pod
The plugin reads the bearer token from the *-agent-token Secret automatically, so there is no separate login step.
Installation
shell
git clone https://github.com/pvc-explorer-operator/kubectl-pvc-explorer.git
cd kubectl-pvc-explorer
make installVerify:
shell
kubectl plugin list
kubectl pvc --versionPrerequisites
- Go 1.26+
- kubectl with a valid kubeconfig pointing to a cluster with PVC Explorer installed
- macOS: macFUSE (only for the
mountcommand)
Commands
| Command | Description |
|---|---|
kubectl pvc cat <pvc> <path> | Display file contents |
kubectl pvc cp <src> <dest> | Upload/download files (supports glob patterns) |
kubectl pvc exec <pvc> -- <cmd> | Execute commands inside the agent pod |
kubectl pvc list | List all PVCExplorer resources |
kubectl pvc ls <pvc> [path] | List files on a PVC |
kubectl pvc mount <pvc> <dir> | FUSE mount (experimental) |
kubectl pvc sleep <pvc> | Scale agent back to 0 |
kubectl pvc wake <pvc> | Scale agent from 0 to 1 (--wait 2m to wait for readiness) |
Quick Start
shell
# Wake the agent
kubectl pvc wake my-pvc -n my-namespace
# Browse files
kubectl pvc ls my-pvc -n my-namespace /data
# Download a file
kubectl pvc cp my-pvc:/data/config.yaml ./config.yaml
# Upload a file
kubectl pvc cp ./local-file.txt my-pvc:/remote/dir/
# Execute a command
kubectl pvc exec my-pvc -n my-namespace -- ls -la
# Sleep when done
kubectl pvc sleep my-pvc -n my-namespaceLocal Development
The project includes a Kind-based local environment in the pvc-explorer repo:
shell
cd pvc-explorer
./kind/setup.sh
cd ../kubectl-pvc-explorer
make install
kubectl pvc listRepository
- Source: github.com/pvc-explorer-operator/kubectl-pvc-explorer
- License: Apache 2.0