In order to create a VM that uses a NFS PVC, do the following:
- Create a NFS storage class
kubectl create -f 01-nfs-sc.yaml
- Create the NFS server
kubectl create -f 02-nfs-server.yaml
- Create the NFS service
kubectl create -f 03-nfs-service.yaml
- Get the NFS service ip, and update
04-nfs-pv.yaml
with it
SERVICE_IP=$(kubectl get service nfs-service --no-headers | awk '{print $3}')
sed s/NFS_SERVICE_IP/$SERVICE_IP/ 04-nfs-pv.yaml | kubectl create -f -
For each time you use a PV, create a new PV manually by changing its name and path.
Recycle old used pv, by deleting their disk.img in the nfs-server podrm -rf /data/nfs/disk%d/disk.img
- Optional - you can validate it works, by creating a dv using
05-example-dv.yaml
(don't forget to update the EXAMPLE_URL to whatever URL that will be pulled) - Update the VM
06-vm_rhel6_e1000e.yaml
RHEL6_QCOW_IMAGE_URL, and create it.
Console using the credentials that appear in the cloud-init.