'why the nfs volume take the host disk space in kubelet folder
Today I found the host kubelet(v1.21.3) path take 6GB + space, the folder path like this:
/var/lib/kubelet/pods/8aafe99f-53c1-4bec-8cb8-abd09af1448f/volumes/kubernetes.io~nfs/nfs-reddwarf-postgresql-pv-general
the folder nfs-reddwarf-postgresql-pv-general folder was in the NAS file system which was monunted to the host path /data, why still take 6GB+ spaces? what should I do to make it using the NAS spaces not the host? The host only have 40GB space. This is the disk spaces check command:
[root@k8smasterone kubernetes.io~nfs]# du -sh nfs-reddwarf-postgresql-pv-general
6.1G nfs-reddwarf-postgresql-pv-general
this is part of the NFS mount config with PV:
spec:
capacity:
storage: 8Gi
nfs:
server: 12345-xxx.cn-shanghai.nas.aliyuncs.com
path: /k8s/reddwarf-storage/postgresql
accessModes:
- ReadWriteOnce
claimRef:
kind: PersistentVolumeClaim
namespace: reddwarf-storage
name: data-reddwarf-postgresql-postgresql-general
uid: 0bc07cdb-d673-4038-beba-171b3cb83a16
apiVersion: v1
resourceVersion: '21952656'
persistentVolumeReclaimPolicy: Retain
mountOptions:
- vers=4.0
- noresvport
volumeMode: Filesystem
this is part of the PVC config:
status:
phase: Bound
accessModes:
- ReadWriteOnce
capacity:
storage: 8Gi
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
volumeName: nfs-reddwarf-postgresql-pv-general
volumeMode: Filesystem
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
