text
stringlengths
0
59.1k
portworxVolume:
volumeID: "<vol-id>"
fsType: "<fs-type>"
```
Make sure to replace <vol-id>, <size> and <fs-type> in the above spec with
the ones that you used while creating the volume.
[Download example](portworx-volume-pv.yaml?raw=true)
Creating the persistent volume:
``` bash
$ kubectl create -f examples/volumes/portworx/portworx-volume-pv.yaml
```
Verifying persistent volume is created:
``` bash
$ kubectl describe pv pv0001
Name: pv0001
Labels: <none>
StorageClass:
Status: Available
Claim:
Reclaim Policy: Retain
Access Modes: RWO
Capacity: 2Gi
Message:
Source:
Type: PortworxVolume (a Portworx Persistent Volume resource)
VolumeID: pv0001
FSType: ext4
No events.
```
2. Create Persistent Volume Claim.
Example spec:
```yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc0001
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: <size>Gi
```
[Download example](portworx-volume-pvc.yaml?raw=true)
Creating the persistent volume claim:
``` bash
$ kubectl create -f examples/volumes/portworx/portworx-volume-pvc.yaml
```
Verifying persistent volume claim is created:
``` bash
$ kubectl describe pvc pvc0001
Name: pvc0001
Namespace: default
Status: Bound
Volume: pv0001
Labels: <none>
Capacity: 2Gi
Access Modes: RWO
No events.
```
3. Create Pod which uses Persistent Volume Claim.
See example:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: pvpod
spec:
containers:
- name: test-container
image: registry.k8s.io/test-webserver
volumeMounts:
- name: test-volume
mountPath: /test-portworx-volume
volumes:
- name: test-volume
persistentVolumeClaim:
claimName: pvc0001
```
[Download example](portworx-volume-pvcpod.yaml?raw=true)
Creating the pod: