单例部署
1 | apiVersion: extensions/v1beta1 |
集群部署
1 | apiVersion: apps/v1beta1 |
1 | kind: StorageClass |
查看pv和pvc
1 | kubectl get pv / pvc |
1 | NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE |
因为这里使用StorageClass方式,则动态创建PV并绑定PVC
1 | apiVersion: extensions/v1beta1 |
1 | apiVersion: apps/v1beta1 |
1 | kind: StorageClass |
查看pv和pvc
1 | kubectl get pv / pvc |
1 | NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE |
因为这里使用StorageClass方式,则动态创建PV并绑定PVC