英文:
Does hotPath reserve specified amount of storage in node
问题
以下是您要翻译的内容:
我有一个静态的PV规范,使用hostPath。
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysqlvol
spec:
storageClassName: manual
capacity:
storage: 10Gi #卷的大小
accessModes:
- ReadWriteOnce #访问类型 # RWO RWX ROX
hostPath:
path: "/tmp/new.txt" #主机位置
在节点上,我在/tmp
下看不到10Gi
的存储空间。存储是如何为hostPath保留的。
pvc规范
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysqlvol
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi # < 10Gi
pod规范
apiVersion: v1
kind: Pod
metadata:
name: task-pv-pod
spec:
volumes:
- name: task-pv-storage
persistentVolumeClaim:
claimName: mysqlvol
containers:
- name: task-pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: task-pv-storage
我能够写入超过10GiB的数据。
root@task-pv-pod:/usr/share/nginx/html# ls -lh
total 15G
-rw-r--r-- 1 root root 15G May 22 04:16 bigfile.txt
-rw-r--r-- 1 root root 3 May 18 12:04 new.txt
root@task-pv-pod:/usr/share/nginx/html#
- 这里的
10GiB
的相关性是什么,因为我可以在卷中写入任意数量的数据[15GiB也可以]? - 为什么当请求大小大于10GiB时PVC创建失败,考虑到卷能够容纳更大的大小?
英文:
I have a static PV spec, using hostPath.
apiVersion: v1
kind: PersistentVolume
metadata:
name: mysqlvol
spec:
storageClassName: manual
capacity:
storage: 10Gi #Size of the volume
accessModes:
- ReadWriteOnce #type of access # RWO RWX ROX
hostPath:
path: "/tmp/new.txt" #host location
In the node I don't see 10Gi
of storage under /tmp.
How is storage reserved for hostPath.
pvc spec
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysqlvol
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi # < 10Gi
pod spec
apiVersion: v1
kind: Pod
metadata:
name: task-pv-pod
spec:
volumes:
- name: task-pv-storage
persistentVolumeClaim:
claimName: mysqlvol
containers:
- name: task-pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: task-pv-storage
I am able to write data > 10GiB.
root@task-pv-pod:/usr/share/nginx/html# ls -lh
total 15G
-rw-r--r-- 1 root root 15G May 22 04:16 bigfile.txt
-rw-r--r-- 1 root root 3 May 18 12:04 new.txt
root@task-pv-pod:/usr/share/nginx/html#
- What is the relevance of
10GiB
here as I can write any amount of data in the volume [ 15GiB also works ] - Why does PVC creation fail when request size is > 10GiB given the fact that volume is capable of accommodating higher size.
答案1
得分: 1
没有存储保留,也没有配额。
您声明卷的容量为10GiB,当创建具有该请求的PVC时,它将与声明的空间匹配。
英文:
There is no storage reservation, nor quota.
You declare that the volume is capable of 10GiB and when a PVC with that request is created, it is matched against the declared space.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论