text
stringlengths
0
59.1k
claimName: pvcsc001
<|endoftext|>
# source: k8s_examples/_archived/volumes/portworx/README.md type: docs
# Portworx Volume
- [Portworx](#portworx)
- [Prerequisites](#prerequisites)
- [Examples](#examples)
- [Using Pre-provisioned Portworx Volumes](#pre-provisioned)
- [Running Pod](#running-pod)
- [Persistent Volumes](#persistent-volumes)
- [Using Dynamic Provisioning](#dynamic-provisioning)
- [Storage Class](#storage-class)
## Portworx
[Portworx](http://www.portworx.com) can be used as a storage provider for your Kubernetes cluster. Portworx pools your servers capacity and turns your servers
or cloud instances into converged, highly available compute and storage nodes
## Prerequisites
- A Portworx instance running on all of your Kubernetes nodes. For
more information on how you can install Portworx can be found [here](http://docs.portworx.com)
## Examples
The following examples assumes that you already have a running Kubernetes cluster with Portworx installed on all nodes.
### Using Pre-provisioned Portworx Volumes
Create a Volume using Portworx CLI.
On one of the Kubernetes nodes with Portworx installed run the following command
```shell
/opt/pwx/bin/pxctl volume create <vol-id> --size <size> --fs <fs-type>
```
#### Running Pods
Create Pod which uses Portworx Volumes
Example spec:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: test-portworx-volume-pod
spec:
containers:
- image: registry.k8s.io/test-webserver
name: test-container
volumeMounts:
- mountPath: /test-portworx-volume
name: test-volume
volumes:
- name: test-volume
# This Portworx volume must already exist.
portworxVolume:
volumeID: "<vol-id>"
fsType: "<fs-type>"
```
[Download example](portworx-volume-pod.yaml?raw=true)
Make sure to replace <vol-id> and <fs-type> in the above spec with
the ones that you used while creating the volume.
Create the Pod.
``` bash
$ kubectl create -f examples/volumes/portworx/portworx-volume-pod.yaml
```
Verify that pod is running:
```bash
$ kubectl.sh get pods
NAME READY STATUS RESTARTS AGE
test-portworx-volume-pod 1/1 Running 0 16s
```
#### Persistent Volumes
1. Create Persistent Volume.
Example spec:
```yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: <vol-id>
spec:
capacity:
storage: <size>Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain