简体   繁体   English

检查 Kubernetes 集群中的存储容量

[英]Check for storage capacity in kubernetes cluster

This question is regarding kubernetes storage.这个问题是关于 Kubernetes 存储的。 I am using a local kubernetes cluster where while some applications to be deployed need to be backed by pvcs.我正在使用本地 kubernetes 集群,其中一些要部署的应用程序需要由 pvcs 支持。 The PVC are provisioned dynamically . PVC 是动态提供的。 However, sometimes when there is no storage left on the cluster the pvc request just gets stuck in forever pending state.然而,有时当集群上没有剩余存储空间时,pvc 请求就会陷入永远挂起的状态。

Is there any way that the available storage on the kubernetes cluster be checked?有什么办法可以检查 kubernetes 集群上的可用存储吗? Checked extensively in the docs and it is just not clear how to check remaining storage capacity on a kubernetes cluster.在文档中进行了广泛检查,但不清楚如何检查 Kubernetes 集群上的剩余存储容量。

Also, as per kubernetes docs the capacity of a node is different and the pvc allocation is bound to the pv which are a completely separate cluster resource just like nodes.此外,根据 kubernetes 文档,节点的容量是不同的,并且 pvc 分配绑定到 pv,这是一个完全独立的集群资源,就像节点一样。

In that case what storage do I need to check to find if there's any space available for say an x gb dynamic pvc?在这种情况下,我需要检查哪些存储空间以查找是否有任何可用空间用于 x gb 动态 pvc? Also, how do i check it?另外,我如何检查它?

You can use tools for monitoring resources .您可以使用工具来监视资源

One of it is Prometheus you can combine it with Grafana to visualize collected metrics.其中之一是Prometheus,您可以将它与Grafana结合起来以可视化收集的指标。

Also take a look on compute-resources-consumption-monitoring .另请查看计算资源消耗监控

When local ephemeral storage is used, it is monitored on an ongoing basis by the kubelet.当使用本地临时存储时,kubelet 会对其进行持续监控。 The monitoring is performed by scanning each emptyDir volume, log directories, and writable layers on a periodic basis.监控是通过定期扫描每个 emptyDir 卷、日志目录和可写层来执行的。 Starting with Kubernetes 1.15, emptyDir volumes (but not log directories or writable layers) may, at the cluster operator's option, be managed by use of project quotas.从 Kubernetes 1.15 开始,emptyDir 卷(但不是日志目录或可写层)可以由集群运营商选择,通过使用项目配额进行管理。 Project quotas were originally implemented in XFS, and have more recently been ported to ext4fs.项目配额最初是在 XFS 中实现的,最近被移植到 ext4fs。 Project quotas can be used for both monitoring and enforcement;项目配额可用于监控和执行; as of Kubernetes 1.16, they are available as alpha functionality for monitoring only.从 Kubernetes 1.16 开始,它们仅作为 alpha 功能用于监控。

Quotas are faster and more accurate than directory scanning.配额比目录扫描更快、更准确。 When a directory is assigned to a project, all files created under a directory are created in that project, and the kernel merely has to keep track of how many blocks are in use by files in that project.当一个目录被分配给一个项目时,在该目录下创建的所有文件都会在该项目中创建,内核只需跟踪该项目中的文件正在使用多少块。 If a file is created and deleted, but with an open file descriptor, it continues to consume space.如果一个文件被创建和删除,但文件描述符是打开的,它会继续消耗空间。 This space will be tracked by the quota, but will not be seen by a directory scan.该空间将被配额跟踪,但不会被目录扫描看到。

To enable use of project quotas, the cluster operator must do the following:要启用项目配额的使用,集群运营商必须执行以下操作:

  • enable the LocalStorageCapacityIsolationFSQuotaMonitoring=true feature gate in the kubelet configuration.在 kubelet 配置中启用LocalStorageCapacityIsolationFSQuotaMonitoring=true功能门。 This defaults to false in Kubernetes 1.16, so must be explicitly set to true这在 Kubernetes 1.16 中默认为 false,因此必须显式设置为 true
  • make sure that the root partition (or optional runtime partition) is built with project quotas enabled.确保在启用项目配额的情况下构建根分区(或可选的运行时分区)。 Take notice on that all XFS filesystems support project quotas, but ext4 filesystems must be built specially.请注意,所有 XFS 文件系统都支持项目配额,但 ext4 文件系统必须专门构建。

Make sure that the root partition (or optional runtime partition) is mounted with project quotas enabled.确保在启用项目配额的情况下挂载了根分区(或可选的运行时分区)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何增加Kubernetes中已部署集群的存储容量? - How to increase storage capacity of already deployed cluster in Kubernetes? 如何检查 kube.netes 集群中剩余的核心数和内存容量 - How to check number of cores and ram capacity left in kubernetes cluster csi-cephfs:如何从 kubernetes 获取 ceph 存储集群可用容量 - csi-cephfs: how can I get ceph storage cluster available capacity from kubernetes kubernetes PersistentVolumes的最大存储容量是多少 - What is the maximum storage capacity for kubernetes PersistentVolumes Kubernetes 集群 Mysql 节点存储 - Kubernetes cluster Mysql Nodes Storage 是否有任何 API 或 Go 编程逻辑来获取 kubernetes 集群中的节点容量? - Is there any API or go programming logic to get capacity of node in a kubernetes cluster? 如何检查 kubernetes 集群的健康状况 - How to check health of kubernetes cluster 将 jaeger 与 Kubernetes 集群上的 elasticsearch 后端存储连接起来 - Connecting jaeger with elasticsearch backend storage on kubernetes cluster kubernetes 中的存储类是集群级对象吗? - Is storage classes cluster level objects in kubernetes? Kubernetes 集群中的“慢”存储 class 在哪里配置? - Where is configured the "slow" storage class in a Kubernetes Cluster?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM