K8S持久化儲存PV PVC筆記

2022-06-22 19:48:11 字數 474 閱讀 8576

kubernetes 使用persistent volume和persistent volume claim 兩種api資源來管理儲存。

可以通過兩種方式配置pv:靜態或動態。

關於persistentvolume的訪問方式

在cli(命令列介面)中,訪問模式縮寫為:

特別注意:  卷只能一次使用一種訪問模式安裝,即使它支援很多。

關於**策略

目前,只有nfs和hostpath支援**。aws ebs,gce pd,azure磁碟和cinder卷支援刪除。

關於persistentvolume (pv) 狀態

關於persistentvolumeclaims (pvc) 狀態

k8s持久化儲存PV PVC部署

安裝nfs utils rpcbindyum install nfs utils rpcbind nfs utils所有節點都需要安裝 啟動systemctl restart rpcbind nfs編輯共享配置檔案 在主機節點編輯 vim etc exports寫入 mnt share rw 如果沒...

k8s 資料持久化儲存

pod重啟,資料依然存在 1 找一台伺服器作為nfs服務端 1 安裝nfs yum install y nfs utils 2 設定掛載路徑 vi etc exports data nfs rw,no root squash 3 設定的掛載路徑首先保證有這個路徑,沒有則建立 mkdir data m...

K8S 使用cephfs 作為持久化儲存

1 檢視ceph的key 進入ceph集群的管理主機 ceph auth get key client.admin base64 得到這個串,下面使用 2 k8s裡面新增乙個密碼 cat apiversion v1 kind secret metadata name ceph secret data...