TKE跨云联网挂载CFS

2022-07-17 18:13:29 浏览数 (1)

目前TKE使用PVC和PV创建CFS,只能选择当前VPC下的CFS实例。有时用户有诉求,想挂载其他VPC下的CFS实例可以参考如下:

代码语言:txt复制
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-ccn
spec:
  accessModes:
     - ReadWriteMany
  capacity:
     storage: 10Gi
  csi:
    driver: com.tencent.cloud.csi.cfs
    volumeAttributes:
       host: 10.2.2.66
       path: /
    volumeHandle: cfs-pv2
  persistentVolumeReclaimPolicy: Retain
  volumeMode: Filesystem

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-operationdata
  namespace: default
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
  storageClassName: ""
  volumeMode: Filesystem
  volumeName: pv-operationdata
代码语言:txt复制
[root@tke-node /data]# kubectl  exec -it nginx-d98d55878-445cv bash
root@nginx-d98d55878-445cv:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          50G  7.8G   39G  17% /
tmpfs            64M     0   64M   0% /dev
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
10.2.2.66:/      10G   32M   10G   1% /mnt
/dev/vda1        50G  9.6G   38G  21% /etc/hosts
/dev/vdb         50G  7.8G   39G  17% /etc/hostname
shm              64M     0   64M   0% /dev/shm
tmpfs           3.9G   12K  3.9G   1% /run/secrets/kubernetes.io/serviceaccount
tmpfs           3.9G     0  3.9G   0% /proc/acpi
tmpfs           3.9G     0  3.9G   0% /proc/scsi
tmpfs           3.9G     0  3.9G   0% /sys/firmware
root@nginx-d98d55878-445cv:/# cd /mnt/
root@nginx-d98d55878-445cv:/mnt# ls
123  aa  bb  data  etc  vshm4707

0 人点赞