[k8s] storage of pv and pvc

 

[4.4]
## pv and pvc

# (1) SFS Turbo :
#     name = sfs-turbo-k8s

# (2) CCE Storage UI:
#     ① 存储卷声明类型:极速文件存储
#     ② PVC名称:cce-efs-import-mypvc 
#     ③ 创建方式:新建存储卷 , 选择 sfs-turbo-k8s
 # ④ 极速文件存储:选择默认 # ⑤ PV名称:sfs-turbo-k8s  kubectl get pv kubectl get pvc

 

[4.5]
## create pod to use PVC

vim testpod.yaml

apiVersion: v1
kind: Pod
metadata:
  labels:
    test: pvctest
  name: pvcpod
spec:
  containers:
  - name: busybox
    args:
    - /bin/sh
    - -c
    - sleep 30000;
    image: busybox
    volumeMounts:
    - mountPath: /pvcdir
      name: pvc-volume
  volumes:
  - name: pvc-volume
    persistentVolumeClaim:
      claimName: cce-efs-import-mypvc


kubectl apply -f testpod.yaml



kubectl exec -it pvcpod /bin/sh
cd /pvcdir
echo "hello pvc" > hello
exit


ssh cce01-node1-IP
df -h | grep sfs
cd mount-directory

cat hello
rm -f  hello
exit


kubectl delete pod pvcpod
kubectl delete pvc cce-efs-import-mypvc

 

posted on 2025-04-12 10:29  天涯人  阅读(15)  评论(0)    收藏  举报

导航