[英]kubernetes persistence volume and persistence volume claim exceeded storage
By following kubernetes guide i have created a pv, pvc and pod.通过遵循 kubernetes 指南,我创建了一个 pv、pvc 和 pod。 i have claimed only 10Mi of out of 20Mi pv.
我只声称了 20Mi pv 中的 10Mi。 I have copied 23Mi that is more than my pv.
我复制了比我的 pv 还多的 23Mi。 But my pod is still running.
但我的 pod 仍在运行。 Can any one explain ?
谁能解释一下?
pv-volume.yaml pv-volume.yaml
kind: PersistentVolume
apiVersion: v1
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 20Mi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
pv-claim.yaml pv-claim.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: task-pv-claim
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Mi
pv-pod.yaml pv-pod.yaml
kind: Pod
apiVersion: v1
metadata:
name: task-pv-pod
spec:
volumes:
- name: task-pv-storage
persistentVolumeClaim:
claimName: task-pv-claim
containers:
- name: task-pv-container
image: nginx
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: task-pv-storage
Probably you can copy as much data into shared storage /mnt/data (on your active node) using any of applied POD's storages , /usr/share/nginx/html , shared between node and pods till your node will stop responding.可能您可以使用任何应用的 POD 存储/usr/share/nginx/html将尽可能多的数据复制到共享存储/mnt/data (在您的活动节点上),在节点和 Pod 之间共享,直到您的节点停止响应。
In case you need to test this scenario in more real conditions could you please consider create NFS persistent storage using GlusterFS , nfs-utils , or mount a raw partition file made with dd .如果您需要在更真实的条件下测试这个场景,您可以考虑使用GlusterFS 、 nfs-utils创建 NFS 持久存储,或者挂载使用dd制作的原始分区文件。
In Minikube nodes are using ephemeral-storages. Minikube 节点使用临时存储。 Detailed information about node/pod resources you can find here:
您可以在此处找到有关节点/pod 资源的详细信息:
https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable
Hope this help.希望这有帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.