Using the Block Storage storage class
Deploying Pods and PVCs Using Storage Classes
매니페스트 파일(예시:
bs-pod.yaml
와
bs-pvc.yaml
)을 작성하여 bs-ssd를 사용하는 Pod와 Pvc를 배포할 수 있습니다.
- The manifest file below is an example. * Please adjust key fields such as Image to suit the user’s environment.
Follow these steps to create a Pod and PVC using the bs-ssd storage class.
Pvc 매니페스트 파일
bs-pvc.yaml을 작성합니다.Color modekind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-bs-ssd spec: accessModes: - ReadWriteOnce storageClassName: bs-ssd volumeMode: Filesystem resources: requests: storage: 8Gikind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-bs-ssd spec: accessModes: - ReadWriteOnce storageClassName: bs-ssd volumeMode: Filesystem resources: requests: storage: 8GiCode block. Example of creating a PVC manifest file bs-pvc.yaml Pod 매니페스트 파일
bs-pod.yaml을 작성합니다.Color modekind: Pod apiVersion: v1 metadata: name: pod-bs-ssd spec: containers: - name: busybox image: busybox:latest command: - sleep - 3600 volumeMounts: - mountPath: "/data" name: my-csi-volume volumes: - name: my-csi-volume persistentVolumeClaim: claimName: pvc-bs-ssdkind: Pod apiVersion: v1 metadata: name: pod-bs-ssd spec: containers: - name: busybox image: busybox:latest command: - sleep - 3600 volumeMounts: - mountPath: "/data" name: my-csi-volume volumes: - name: my-csi-volume persistentVolumeClaim: claimName: pvc-bs-ssdCode block. Example of a Service manifest file bs-pod.yaml Deploy the Pvc and Pod manifests using the kubectl apply command.
Color modekubectl apply -f bs-pvc.yaml -f bs-pod.yamlkubectl apply -f bs-pvc.yaml -f bs-pod.yamlcode block. Deploy the manifest with the kubectl apply command. kubectl get pod,pvc명령어를 사용하여 배포 결과를 확인합니다.Color mode# kubectl get pod,pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS persistentvolumeclaim/pvc-bs-ssd Bound pvc-5a085a06-164f-45e1-b4c6-d2bfa3b0012c 8Gi RWO bs-ssd NAME READY STATUS RESTARTS AGE pod/pod-bs-ssd 1/1 Running 0 75s# kubectl get pod,pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS persistentvolumeclaim/pvc-bs-ssd Bound pvc-5a085a06-164f-45e1-b4c6-d2bfa3b0012c 8Gi RWO bs-ssd NAME READY STATUS RESTARTS AGE pod/pod-bs-ssd 1/1 Running 0 75sCode block. Check deployment results with the kubectl get pod,pvc command.
Deploy Pod and PVC to a specific AZ (allowedTopologies)
A user can create a separate storage class that includes the allowedTopologies setting, enabling Pods and volumes to be scheduled to a specific AZ.
- Based on the default deployed bs-ssd storage class, we recommend creating additional storage classes.
- It is recommended to use “topology.bs.csi.samsungsdscloud.com/zone” with matchLabelExpressions. * (Label not applied to all nodes)
storageclass 매니페스트 파일
bs-az-a-sc.yaml을 작성합니다.Color modeapiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: bs-ssd-az-a provisioner: bs.csi.samsungsdscloud.com reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer allowVolumeExpansion: true parameters: type: SSD allowedTopologies: - matchLabelExpressions: - key: topology.bs.csi.samsungsdscloud.com/zone values: - kr-west1-aapiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: bs-ssd-az-a provisioner: bs.csi.samsungsdscloud.com reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer allowVolumeExpansion: true parameters: type: SSD allowedTopologies: - matchLabelExpressions: - key: topology.bs.csi.samsungsdscloud.com/zone values: - kr-west1-aCode block. Example of writing a Pvc manifest file bs-az-a-sc.yaml Deploy the Storageclass, Pvc, and Pod manifests using the kubectl apply command.
Color modekubectl apply -f bs-az-a-sc.yaml -f bs-pvc.yaml -f bs-pod.yamlkubectl apply -f bs-az-a-sc.yaml -f bs-pvc.yaml -f bs-pod.yamlcode block. Deploy the manifest with the kubectl apply command. kubectl get pod,pvc명령어를 사용하여 배포 결과를 확인합니다.Color mode# kubectl get pod,pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS pvc-bs-ssd Bound pvc-42365cee-724c-446a-af35-e54d9b16ad51 8Gi RWO bs-ssd-az-a NAME READY STATUS RESTARTS AGE IP NODE pod-bs-ssd 1/1 Running 0 46s 172.21.52.3 ske-aaa-lrwdj-vwww2# kubectl get pod,pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS pvc-bs-ssd Bound pvc-42365cee-724c-446a-af35-e54d9b16ad51 8Gi RWO bs-ssd-az-a NAME READY STATUS RESTARTS AGE IP NODE pod-bs-ssd 1/1 Running 0 46s 172.21.52.3 ske-aaa-lrwdj-vwww2Code block. Check deployment results with the kubectl get pod,pvc command.
Deploying Pods and PVCs using the ssd_provisioned volume type
Users can specify the max_iops and max_throughput of a volume created using the SSD_Provisioned volume type. max_iops and max_throughput can be specified in the storage class parameters (2nd priority) of the created PVC Annotation (1st priority). The example below demonstrates a case that incorporates both settings. (If all are set, the PVC Annotation value is applied.)
- Based on the default deployed bs-ssd storage class, we recommend creating additional storage classes.
- If max_iops and max_throughput are not applied, the PVC creation request will fail.
storageclass 매니페스트 파일
bs-ssdprovisioned-sc.yaml을 작성합니다.Color modeapiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: bs-ssdprovisioned-sc provisioner: bs.csi.samsungsdscloud.com reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer allowVolumeExpansion: true parameters: type: SSD_Provisioned # Volume type change (SSD > SSD_Provisioned) max_iops: "17000" # max_iops setting (5000-20000) max_throughput: "250" # max_throughput setting (250-1000)apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: name: bs-ssdprovisioned-sc provisioner: bs.csi.samsungsdscloud.com reclaimPolicy: Delete volumeBindingMode: WaitForFirstConsumer allowVolumeExpansion: true parameters: type: SSD_Provisioned # Volume type change (SSD > SSD_Provisioned) max_iops: "17000" # max_iops setting (5000-20000) max_throughput: "250" # max_throughput setting (250-1000)Code block. Example of creating a PVC manifest file bs-ssdprovisioned-sc.yaml Pvc 매니페스트 파일
bs-ssdprovisioned-pvc.yaml을 작성합니다.Color modekind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-bs-ssdprovisioned annotations: "bs.csi.samsungsdscloud.com/max-iops": "5000" # max_iops setting "bs.csi.samsungsdscloud.com/max-throughput": "250" # max_throughput setting spec: accessModes: - ReadWriteOnce storageClassName: bs-ssdprovisioned-sc volumeMode: Filesystem resources: requests: storage: 8Gikind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-bs-ssdprovisioned annotations: "bs.csi.samsungsdscloud.com/max-iops": "5000" # max_iops setting "bs.csi.samsungsdscloud.com/max-throughput": "250" # max_throughput setting spec: accessModes: - ReadWriteOnce storageClassName: bs-ssdprovisioned-sc volumeMode: Filesystem resources: requests: storage: 8GiCode block. Example of creating a PVC manifest file bs-ssdprovisioned-pvc.yaml Deploy the Storageclass, Pvc, and Pod manifests using the kubectl apply command.
Color modekubectl apply -f bs-ssdprovisioned-sc.yaml -f bs-ssdprovisioned-pvc.yaml -f bs-pod.yamlkubectl apply -f bs-ssdprovisioned-sc.yaml -f bs-ssdprovisioned-pvc.yaml -f bs-pod.yamlcode block. Deploy the manifest with the kubectl apply command. The max-iops and max-throughput values of the created volume can be viewed in the console under Virtual Server > Block Storage.
Below is an explanation of the max-iops and max-throughput PVC annotations.
| Annotation | Essential | Default | Scope | Explanation |
|---|---|---|---|---|
| bs.csi.samsungscloud.com/max-iops | Optional | - | 5000-20000 | IOPS value set when creating the service |
| bs.csi.samsungscloud.com/max-throughput | Optional | - | 250-1000 | Throughput speed (MB/s) set when creating the service |