The NIFCLOUD Hatoba Disk Container Storage Interface (CSI) Driver provides a CSI interface used by Container Orchestrators to manage the lifecycle of Hatoba Disks.
See the document.
-
Create NIFCLOUD secret.
vi deploy/kubernetes/secret.yaml kubectl apply -f deploy/kubernetes/secret.yaml
-
Set the
NIFCLOUD_HATOBA_CLUSTER_NRN
environment variable.vi deploy/kubernetes/overlys/stable/controller.yaml
-
Deploy drivers.
kubectl apply -k deploy/kubernetes/overlays/stable
-
Create storage class.
csi.storage.k8s.io/fstype
andtype
is selectable parameter. Please see CreateVolume Parameters section.
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: hatoba-disk-high-speed-flash-a provisioner: disk.csi.hatoba.nifcloud.com volumeBindingMode: WaitForFirstConsumer parameters: csi.storage.k8s.io/fstype: ext4 type: high-speed-flash-a allowVolumeExpansion: true
-
Create PVC and Pod.
apiVersion: apps/v1 kind: StatefulSet metadata: name: web spec: serviceName: "nginx" replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: k8s.gcr.io/nginx-slim:0.8 ports: - containerPort: 80 name: web volumeMounts: - name: www mountPath: /usr/share/nginx/html volumeClaimTemplates: - metadata: name: www spec: accessModes: [ "ReadWriteOnce" ] storageClassName: hatoba-disk-high-speed-flash-a resources: requests: storage: 10Gi
-
Driver will craete new disk and attach it to node.
kubectl get pvc kubectl get pv kubectl get pods
There are several optional parameters that could be passes into CreateVolumeRequest.parameters map:
File system type that will be formatted during volume creation
- xfs
- ext2
- ext3
- ext4
ext4
Storage type (See https://pfs.nifcloud.com/service/disk.htm)
- standard-flash-a
- standard-flash-b
- standard-flash (randomly select a or b)
- high-speed-flash-a
- high-speed-flash-b
- high-speed-flash (randomly select a or b)
standard-flash-a