Going back to the end of the previous sub-chapter, we introduce the Rook storage provider. It is inserted between the hard disk of the VMs, always based on NFS, and the Kubernetes cluster. As said previously, NFS allows remote hosts to mount filesystems over a network and interact with those filesystems as though they are mounted locally. This enables system administrators to consolidate resources onto into centralized servers on the network. network and integration with Rook to have greater control over Kubernetes storage-related parameters.
As a prerequisite, NFS client packages must be installed on all nodes (nfs-utils on CentOS), where Kubernetes might run pods with NFS mounted. Except for installing packages, we don't have to go through the usual steps you do when using NFS: edit the /etc/exports file or mount directories on client machines, etc.
...
Note that we have retraced the steps made in the previous sub-chapter. The administrator (backend) creates a SC and makes it available to users (frontend). The user, through the PVC, exploits the SC to generate PV, useful for his purposes. If the user wants, he can of course generate new PVs, thanks to other PVCs, to use them in his applications.
Summary
Let's try to summarize the steps carried out thanks to the visual aid of the screen below.
| Code Block | ||||
|---|---|---|---|---|
| ||||
# With this command you get SC, PV and PVC (of all namespaces)
$ kubectl get sc,pv,pvc -A
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
sc/local-storage (default) kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 60m
sc/rook-nfs-share1 nfs.rook.io/rook-nfs-provisioner Delete Immediate false 40m
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS AGE
pv/local-pv 10Gi RWX Delete Bound rook-nfs/nfs-default-claim local-storage 50m
pv/pvc-66761edb-0b68-4a6e-92c2-016c9ecf1255 10Mi RWX Delete Bound myns/rook-nfs-pv-claim rook-nfs-share 30m
NAMESPACE NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
rook-nfs pvc/nfs-default-claim Bound local-pv 10Gi RWX local-storage 45m
myns pvc/rook-nfs-pv-claim Bound pvc-66761edb-0b68-4a6e-92c2-016c9ecf1255 10Mi RWX rook-nfs-share1 30m |