|
| 1 | + |
| 2 | + |
| 3 | +Loading a sample file, sample.json, requires some setup |
| 4 | +at the volume level. |
| 5 | + |
| 6 | +### Making Data Loadable |
| 7 | + |
| 8 | +#### NFS |
| 9 | + |
| 10 | +If you have an NFS file system, you can create a PV |
| 11 | +of type nfs, then create a PVC that specifically mounts |
| 12 | +that persistent volume, then copy your sample data into |
| 13 | +that location. |
| 14 | + |
| 15 | +Lets assume your NFS mount is at /nfsfileshare on host 192.168.0.107, you can |
| 16 | +create a PV as follows: |
| 17 | + |
| 18 | + |
| 19 | +You then copy your sample data into that PV: |
| 20 | + |
| 21 | + cp sample.json /nfsfileshare |
| 22 | + |
| 23 | +You then create the PVC, csv-pvc, which is referenced by |
| 24 | +the sample load configuration. |
| 25 | + |
| 26 | + |
| 27 | +#### Storage Class - StorageOS |
| 28 | + |
| 29 | +We test with storageos and it offers a RWO storage class |
| 30 | +that can be used for volume provisioning. |
| 31 | + |
| 32 | +To accomplish this, download the storageos CLI from their github site. |
| 33 | + |
| 34 | +To prepare a volume with sample load data, you do the following |
| 35 | +for storageos: |
| 36 | + |
| 37 | +Create the PVC that will create a blank storageos volume |
| 38 | +for us to use: |
| 39 | + |
| 40 | + kubectl create -f csv-pvc-sc.yaml |
| 41 | + |
| 42 | +Next, locate the storageos Kube IP address: |
| 43 | + |
| 44 | + kubectl get svc -n storgeos |
| 45 | + |
| 46 | +As root, set up the storageos environment variables required by the |
| 47 | +storageos CLI: |
| 48 | + |
| 49 | + export KUBECONFIG=/etc/kubernetes/admin.conf |
| 50 | + export STORAGEOS_HOST=10.101.214.130 |
| 51 | + export STORAGEOS_PASSWORD=storageos STORAGEOS_USERNAME=storageos |
| 52 | + storageos volume ls |
| 53 | + |
| 54 | +Locate the volume path/name from the above volume listing, then use |
| 55 | +that path in a mount command: |
| 56 | + |
| 57 | + storageos volume mount pgouser1/pvc-3c7491f5-5b9e-11e9-a4a4-52540030262d /mnt |
| 58 | + |
| 59 | +The above command mounts the storageos volume into /mnt on your local |
| 60 | +linux host where you can now access it using normal linux commands. |
| 61 | + |
| 62 | +Next, you copy the sample data file into the storageos volume |
| 63 | +which is mounted on your linux host at /mnt: |
| 64 | + |
| 65 | + sudo cp sample.json /mnt |
| 66 | + |
| 67 | +Unmount the volume so that it can be mounted by the load job: |
| 68 | + |
| 69 | + storageos volume unmount pgouser1/pvc-3c7491f5-5b9e-11e9-a4a4-52540030262d |
| 70 | + |
| 71 | +At this point, you have a storageos backed PVC, csv-pvc, that has |
| 72 | +the sample.json file loaded into it and its ready to be used |
| 73 | +by the load job. One last change is required to mount the storageos |
| 74 | +volume within the Operator load job, that is to add a SecurityContext |
| 75 | +to the load job configuration: |
| 76 | + |
| 77 | + SecurityContext: "securityContext":{"fsGroup":26}, |
0 commit comments