当前位置:网站首页>CBS type PVC recycling strategy
CBS type PVC recycling strategy
2022-07-19 13:51:00 【Chenjingwei】
StorageClass The recycling strategy is reclaimPolicy: Delete
1, Static creation PV, Don't specify StorageClass
apiVersion: v1
kind: PersistentVolume
metadata:
name: cbs-pv
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
csi:
driver: com.tencent.cloud.csi.cbs
volumeHandle: disk-h2v5jzxy
persistentVolumeReclaimPolicy: Retain
volumeMode: Filesystemestablish PVC When , Also need not specify StorageClass To choose this pv, If specified, you cannot select this pv( The tip is : At present PersistentVolume And PersistentVolumeClaim As specified by the StorageClass atypism )
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cbs-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: ""
volumeMode: Filesystem
volumeName: cbs-pv
Delete PVC and PV When , Corresponding CBS The disk will not be recycled and deleted
2, Static creation PV, Appoint StorageClass
apiVersion: v1
kind: PersistentVolume
metadata:
name: cbs-pv
spec:
accessModes:
- ReadWriteOnce
capacity:
storage: 10Gi
csi:
driver: com.tencent.cloud.csi.cbs
volumeHandle: disk-h2v5jzxy
persistentVolumeReclaimPolicy: Retain
storageClassName: cbs
volumeMode: Filesystemestablish PVC, You need to select the corresponding storageclass
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cbs-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: cbs
volumeMode: Filesystem
volumeName: cbs-pvSimulate creating a file of a certain size : dd if=/dev/zero of=hello.txt bs=100M count=1 Delete PVC and PV When , Corresponding CBS The disk will not be recycled and deleted
3, Dynamically create pvc , Don't specify pv, Automatically created pv
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cbs-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: cbsBe careful : because cbs Recovery strategy yes Delete , So delete pvc When , Corresponding PV and CBS The disk will also be deleted automatically
StorageClass The recycling strategy is reclaimPolicy: Retain
4, Dynamically create PVC, Retention policy
1) establish reclaimPolicy: Retain Type of storgeclass and PVC
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: cbs-retain
parameters:
diskChargeType: POSTPAID_BY_HOUR
diskType: CLOUD_PREMIUM
provisioner: com.tencent.cloud.csi.cbs
reclaimPolicy: Retain
volumeBindingMode: Immediate
allowVolumeExpansion: true
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cbs-pvc
namespace: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: cbs-retain
volumeMode: Filesystem2) Then delete the corresponding PVC, And the corresponding PV It didn't delete ,PV Status is Released
[[email protected] ~]# kubectl get pv,pvc
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/pvc-ae7a89e4-3a3c-4f87-b0c9-fffaf91559d2 10Gi RWO Retain Released default/cbs-pvc cbs-retain 2m47s3) Delete separately PV When , Corresponding CBS The disk will not be deleted
[[email protected] ~]# kubectl delete pv pvc-ae7a89e4-3a3c-4f87-b0c9-fffaf91559d2
persistentvolume "pvc-ae7a89e4-3a3c-4f87-b0c9-fffaf91559d2" deleted4) Modify corresponding PV To configure , Delete spec.claimRef part , Corresponding PV Can be with other pvc binding
边栏推荐
- S32K148_ Can drive (bare metal development)
- How to upgrade Flink job gracefully?
- Onvif protocol related: 2.1.3 get the stream address in none mode
- AcWing 136. Adjacent value lookup
- Onvif protocol related: 4.1.3 WS username token method to obtain screenshot URL
- 【7.8】Educational Codeforces Round 131 (Rated for Div. 2)
- Deep learning from getting started to giving up the 100 day challenge
- Simulation of overvoltage protection (OVP) circuit based on PMOS
- Some common operation commands of the command line and solutions to common errors
- 【码蹄集新手村 600 题】针对于字符串的格式化控制,即字符串的宽度与精度
猜你喜欢

Principle of voice communication network

Onvif protocol related: 4.1.4 WS username token method to obtain the stream address
![[pumpkin Book ml] (task2) mathematical derivation of linear model (least squares estimation, generalized Rayleigh quotient, maximum likelihood estimation, etc.)](/img/ab/aaf4c01144364e7999582f326f16af.png)
[pumpkin Book ml] (task2) mathematical derivation of linear model (least squares estimation, generalized Rayleigh quotient, maximum likelihood estimation, etc.)

Flutter uses animatedswitcher to switch scenes

Qt之使用QLisView实现QQ登录历史列表

命令行的一些常用操作命令及常见错误的解决办法

关于数据字典的一些解惑

面试记录

国内外十大erp软件系统排名!
![Codeforce:a. doremy's IQ [reverse greed]](/img/3d/065f9f1cbd857d324b6ed074d1afbf.png)
Codeforce:a. doremy's IQ [reverse greed]
随机推荐
国内外十大erp软件系统排名!
AcWing 136. Adjacent value lookup
(附源码)多种机器学习模型(KNN\LR\RF\Ada\Xg\GBDT...)下的降水降尺度中的模型训练
微服务调用组件feign实战
Android开发大厂面试,做好这3个准备,规划好自己
onvif协议相关:3.1.1 Digest方式获取Authorization
eth入门之运行节点
[code hoof set novice village question 600] formatted input and output, using 0 to replace the completed space
Galaxy Kirin V10 arm offline installation of portal
深度学习从入门到放弃100天挑战
ArrayList underlying analysis
Codeforce:g. good key, bad key [greed]
No.6 representation and operation of floating point numbers
Codeforce:a. difference operations [mathematical thinking]
Some common operation commands of the command line and solutions to common errors
【7.8】Educational Codeforces Round 131 (Rated for Div. 2)
新建一个eureka client
Framework construction of business card management
onvif协议相关:2.1.1 none方式获取token
[cann training camp] Introduction to basic knowledge of shengteng AI