- Created by Sansae, last modified on Mar 06, 2024
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 30 Next »
목차
Volumes 개요
- 컨테이너가 스토리지에 액세스 하고 공유하는 방법
- 각 컨테이너 파일 시스템의 볼륨을 마운트하여 생성
Volume 종류
https://subicura.com/k8s/guide/local-volume.html
Volume 종류 | Volume Type | OverView | 설명 |
---|---|---|---|
임시볼륨 | empty-dir | 파드가 시작될 때 빈 상태로 시작 루트디스크 또는 램에서 제공된다 컨테이너끼리 파일을 공유 Pod가 삭제되면 사라짐 | |
로컬볼륨 | hostpath local | host node에서 제공된다 Pod가 재배포되었을때 node가 달라질 수 있다 node와 파일을 공유하기 위해 사용 | |
네트워크 볼륨 | iSCSI NFS glusterFS ... | 네트워크 스토리지를 사용한다. | |
클라우드 네트워크 볼륨 | azureFile awsEBS gcePersistentDisk ... | https://kimjingo.tistory.com/153 | 클라우드스토리지를 사용한다. |
Persistent Volume(PV) / Persistent Volume Claim(PVC)
http://www.boanproject.com
타입 | 설명 |
---|---|
Static 프로비저닝 | |
Dynamic 프로비저닝 |
Storage Class
sansae@sansaeAir15m2 k8s-lab-workspace % k get sc NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE azurefile file.csi.azure.com Delete Immediate true 2d6h azurefile-csi file.csi.azure.com Delete Immediate true 2d6h azurefile-csi-premium file.csi.azure.com Delete Immediate true 2d6h azurefile-premium file.csi.azure.com Delete Immediate true 2d6h default (default) disk.csi.azure.com Delete WaitForFirstConsumer true 2d6h managed disk.csi.azure.com Delete WaitForFirstConsumer true 2d6h managed-csi disk.csi.azure.com Delete WaitForFirstConsumer true 2d6h managed-csi-premium disk.csi.azure.com Delete WaitForFirstConsumer true 2d6h managed-premium disk.csi.azure.com Delete WaitForFirstConsumer true 2d6h sansae@sansaeAir15m2 k8s-lab-workspace % k edit sc azurefile allowVolumeExpansion: true apiVersion: storage.k8s.io/v1 kind: StorageClass metadata: creationTimestamp: "2024-03-08T01:58:10Z" labels: addonmanager.kubernetes.io/mode: EnsureExists kubernetes.io/cluster-service: "true" name: azurefile resourceVersion: "352" uid: eb098551-1947-41af-9430-3ae37b28c7b8 mountOptions: - mfsymlinks - actimeo=30 - nosharesock parameters: skuName: Standard_LRS provisioner: file.csi.azure.com reclaimPolicy: Delete volumeBindingMode: Immediate
Persistent Volume Claim(PVC) Manifest (Dynamic)
https://dev-k8sref-io.web.app/docs/config-and-storage/persistentvolumeclaim-v1/
apiVersion: v1
kind: PersistentVolumeClaim
metadata (ObjectMeta)
spec (PersistentVolumeClaimSpec)
- accessModes
- selector
- resources
- volumeName
- storageClassName
status (PersistentVolumeClaimStatus)
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: foo-pvc spec: storageClassName: azurefile # 빈 문자열은 명시적으로 설정해야 하며 그렇지 않으면 기본 스토리지클래스가 설정됨 accessModes: [ "ReadWriteOnce" ] resources: requests: storage: 1Gi
Persistent Volume Claim 실습
sansae@sansaeAir15m2 k8s-lab-workspace % k get pv No resources found sansae@sansaeAir15m2 k8s-lab-workspace % k get pvc No resources found in default namespace. sansae@sansaeAir15m2 k8s-lab-workspace % k apply -f pvc.yaml persistentvolumeclaim/foo-pvc created sansae@sansaeAir15m2 k8s-lab-workspace % k get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE foo-pvc Bound pvc-735e1382-f1e1-40f3-8378-25e72ebda4b0 1Gi RWO azurefile 3s sansae@sansaeAir15m2 k8s-lab-workspace % k get pv NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE pvc-735e1382-f1e1-40f3-8378-25e72ebda4b0 1Gi RWO Delete Bound default/foo-pvc azurefile 5s sansae@sansaeAir15m2 k8s-lab-workspace %
- No labels