简体   繁体   English

kubernetes 持久化卷和持久化卷声明超出存储

[英]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 .如果您需要在更真实的条件下测试这个场景,您可以考虑使用GlusterFSnfs-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.

相关问题 持久卷和持久卷声明在 kubernetes 中如何相互绑定 - How persistent volume and persistence volume claim bound each other in kubernetes 如何重命名持久性卷声明? - How to rename persistence volume claim? 当持久性卷声明超过存储时会发生什么? - What happens when a persistence volume claim exceeds storage? 多个持久化卷声明可以绑定到 Kubernetes 中的同一个持久化卷吗 - Can multiple persistence volume claims bind to same persistence volume in Kubernetes 如何监控 kubernetes 持久性卷声明即磁盘使用情况 - How to monitor kubernetes persistence volume claim i.e disk usage 持久化卷更改:在 Kubernetes 容器中重新启动服务 - Persistence volume change: Restart a service in Kubernetes container 使用nfs网络路径作为kubernetes持久卷 - using nfs network path as a kubernetes persistence volume 如何使用Kubernetes Persistence Volume动态创建EBS卷 - How to dynamically create EBS volume with Kubernetes Persistence Volume 在 application.properties 中定义/附加持久性卷声明 - Define/attach Persistence Volume claim in application.properties 使用现有的 Persistence Volume Claim 部署 bitnami/mysql helm chart - Deploying bitnami/mysql helm chart with an existing Persistence Volume Claim
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM