text stringlengths 0 59.1k |
|---|
Create the persistent volume: |
```bash |
$ kubectl create -f examples/volumes/storageos/storageos-pv.yaml |
``` |
Verify that the pv has been created: |
```bash |
$ kubectl describe pv pv0001 |
Name: pv0001 |
Labels: <none> |
Annotations: <none> |
StorageClass: fast |
Status: Available |
Claim: |
Reclaim Policy: Delete |
Access Modes: RWO |
Capacity: 5Gi |
Message: |
Source: |
Type: StorageOS (a StorageOS Persistent Disk resource) |
VolumeName: pv0001 |
VolumeNamespace: |
FSType: ext4 |
ReadOnly: false |
Events: <none> |
``` |
1. Create persistent volume claim |
Example spec: |
```yaml |
apiVersion: v1 |
kind: PersistentVolumeClaim |
metadata: |
name: pvc0001 |
spec: |
accessModes: |
- ReadWriteOnce |
resources: |
requests: |
storage: 5Gi |
storageClassName: fast |
``` |
[Download example](storageos-pvc.yaml?raw=true) |
Create the persistent volume claim: |
```bash |
$ kubectl create -f examples/volumes/storageos/storageos-pvc.yaml |
``` |
Verify that the pvc has been created: |
```bash |
$ kubectl describe pvc pvc0001 |
Name: pvc0001 |
Namespace: default |
StorageClass: fast |
Status: Bound |
Volume: pv0001 |
Labels: <none> |
Capacity: 5Gi |
Access Modes: RWO |
No events. |
``` |
1. Create pod which uses the persistent volume claim |
Example spec: |
```yaml |
apiVersion: v1 |
kind: Pod |
metadata: |
labels: |
name: redis |
role: master |
name: test-storageos-redis-pvc |
spec: |
containers: |
- name: master |
image: kubernetes/redis:v1 |
env: |
- name: MASTER |
value: "true" |
ports: |
- containerPort: 6379 |
resources: |
limits: |
cpu: "0.1" |
volumeMounts: |
- mountPath: /redis-master-data |
name: redis-data |
volumes: |
- name: redis-data |
persistentVolumeClaim: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.