text
stringlengths
0
59.1k
``` bash
$ kubectl create -f examples/volumes/portworx/portworx-volume-pvcpod.yaml
```
Verifying pod is created:
``` bash
$ kubectl get pod pvpod
NAME READY STATUS RESTARTS AGE
pvpod 1/1 Running 0 48m
```
### Using Dynamic Provisioning
Using Dynamic Provisioning and Storage Classes you don't need to
create Portworx volumes out of band and they will be created automatically.
#### Storage Class
Using Storage Classes objects an admin can define the different classes of Portworx Volumes
that are offered in a cluster. Following are the different parameters that can be used to define a Portworx
Storage Class
* `fs`: filesystem to be laid out: none|xfs|ext4 (default: `ext4`)
* `block_size`: block size in Kbytes (default: `32`)
* `repl`: replication factor [1..3] (default: `1`)
* `io_priority`: IO Priority: [high|medium|low] (default: `low`)
* `snap_interval`: snapshot interval in minutes, 0 disables snaps (default: `0`)
* `aggregation_level`: specifies the number of replication sets the volume can be aggregated from (default: `1`)
* `ephemeral`: ephemeral storage [true|false] (default `false`)
1. Create Storage Class.
See example:
```yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
name: portworx-io-priority-high
provisioner: kubernetes.io/portworx-volume
parameters:
repl: "1"
snap_interval: "70"
io_priority: "high"
```
[Download example](portworx-volume-sc-high.yaml?raw=true)
Creating the storageclass:
``` bash
$ kubectl create -f examples/volumes/portworx/portworx-volume-sc-high.yaml
```
Verifying storage class is created:
``` bash
$ kubectl describe storageclass portworx-io-priority-high
Name: portworx-io-priority-high
IsDefaultClass: No
Annotations: <none>
Provisioner: kubernetes.io/portworx-volume
Parameters: io_priority=high,repl=1,snapshot_interval=70
No events.
```
2. Create Persistent Volume Claim.
See example:
```yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvcsc001
annotations:
volume.beta.kubernetes.io/storage-class: portworx-io-priority-high
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
```
[Download example](portworx-volume-pvcsc.yaml?raw=true)
Creating the persistent volume claim:
``` bash
$ kubectl create -f examples/volumes/portworx/portworx-volume-pvcsc.yaml
```
Verifying persistent volume claim is created:
``` bash
$ kubectl describe pvc pvcsc001