Verifying a default StorageClass#
Some operations, such as deploying a remote (SSH-based) cluster, require the management cluster to have a default StorageClass. Follow these steps:
-
If not already installed, install and configure a
StorageClassprovider of your choice. -
Make sure you see the default setting:
kubectl get storageclassYou should see a result such as:
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE mayastor-etcd-localpv openebs.io/local Delete WaitForFirstConsumer false 2m2s openebs-hostpath (default) openebs.io/local Delete WaitForFirstConsumer false 2m2s openebs-loki-localpv openebs.io/local Delete WaitForFirstConsumer false 2m2s openebs-minio-localpv openebs.io/local Delete WaitForFirstConsumer false 2m2s openebs-single-replica io.openebs.csi-mayastor Delete Immediate true 2m2s -
Create a test PVC:
cat <<'EOF' | kubectl apply -f - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: test-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi EOF -
Create a test pod:
cat <<'EOF' | kubectl apply -f - apiVersion: v1 kind: Pod metadata: name: test-pvc-pod spec: containers: - name: test image: busybox command: ["sh", "-c", "echo hello > /data/test.txt && sleep 3600"] volumeMounts: - name: data mountPath: /data volumes: - name: data persistentVolumeClaim: claimName: test-pvc EOF -
Check the results:
kubectl get pod test-pvc-pod kubectl get pvc test-pvcNAME READY STATUS RESTARTS AGE test-pvc-pod 1/1 Running 0 20s NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE test-pvc Bound pvc-61b4dd8b-9bcc-48e3-9055-9f0f80ea9abd 1Gi RWO openebs-hostpath <unset> 36sYou should see the PVC become
Bound. -
Finally, clean up the test:
kubectl delete pod test-pvc-pod kubectl delete pvc test-pvc