靜態建立PV,PVC - daniel-qa/Azure-Kubernetes-Service GitHub Wiki

靜態建立PV,PVC

  1. 先建立檔案共用 ( file share)
  p.s 注意大小設定,要一致
  1. 建立 PV

fileshare_pv.yaml

  • webfile

nginx-www2-pv.yaml

  1. 建立 PVC

fileshare_pvc.yaml

  1. 掛載

fileshare_mount_pod.yaml

  1. 可以使用 UI 檢視file share ,並上傳/修改資料

  • Files share 參考

https://docs.microsoft.com/en-us/azure/aks/azure-files-volume

  • 儲存體類別
這兩個儲存體類別上的回收原則可確保刪除個別 PV 時,會刪除基礎Azure 檔案儲存體共用。 
儲存體類別也會將檔案共用設定為可擴充,

只需要以新的大小編輯 [永續性磁片區宣告](PVC) 。

永續性磁片區宣告 (PVC) 。

  • 資源回收設定參數

persistentVolumeReclaimPolicy

PVC 移除時對應的 PV 動作

Retain  保存資料

預設值 
Delete
對應的 PV 資源和資料一同刪除

Recycle
保留 PV,移除資料