OpenShift PersistentVolume Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:


==NFS==
==NFS==
Create a "pv.yaml" file with the following content:


<pre>
<pre>
Line 30: Line 32:


Make sure the "support.local" server is accessible from any node that will use the volume, and the /support-nfs-storage/metrics is exported and has sufficient permissions.
Make sure the "support.local" server is accessible from any node that will use the volume, and the /support-nfs-storage/metrics is exported and has sufficient permissions.
Then:
oc create -f pv.yaml

Revision as of 05:23, 17 October 2017

Internal

Delete a Persistent Volume

oc delete pv <persistent-volume-name>
oc delete pv metrics-volume

Create a Persistent Volume

NFS

Create a "pv.yaml" file with the following content:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: metrics-volume
spec:
  capacity:
    storage: 10Gi
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  nfs:
    path: /support-nfs-storage/metrics
    server: support.local

Make sure the "support.local" server is accessible from any node that will use the volume, and the /support-nfs-storage/metrics is exported and has sufficient permissions.

Then:

oc create -f pv.yaml