【发布时间】:2020-10-16 16:11:30
【问题描述】:
我有一个 NFS 类型的持久卷,其中有一个在本地运行的源服务器。此 NFS 服务器正在使用 GCP 上的持久卷声明。一切运行良好,但是由于某种原因我无法监控 Prometheus 上的 PVC。它只是没有出现。
问题:如何监控此类磁盘的使用情况?我需要安装一些驱动程序或配置自定义抓取吗?
这是我尝试过的 PromQL 查询:
kubelet_volume_stats_capacity_bytes
kubelet_volume_stats_available_bytes
node_filesystem_size_bytes
注意:我可以在这里看到音量,但我只能看到它的容量,而不是使用量。
kube_persistentvolume_capacity_bytes
这是 NFS 服务器的配置文件:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nfs-server
spec:
replicas: 1
selector:
matchLabels:
role: nfs-server
template:
metadata:
labels:
role: nfs-server
spec:
containers:
- name: nfs-server
image: gcr.io/google_containers/volume-nfs:0.8
ports:
- name: nfs
containerPort: 2049
- name: mountd
containerPort: 20048
- name: rpcbind
containerPort: 111
securityContext:
privileged: true
volumeMounts:
- mountPath: /exports
name: nfs-pvc
volumes:
- name: nfs-pvc
gcePersistentDisk:
pdName: nfs-disk
fsType: ext4
这是 PV 配置:
Status: Bound
Claim: default/nfs-pvc
Reclaim Policy: Retain
Access Modes: RWX
VolumeMode: Filesystem
Capacity: 1000Gi
Node Affinity: <none>
Message:
Source:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: nfs-server.default.svc.cluster.local
Path: /
ReadOnly: false
这是 PVC 配置:
Name: nfs-pvc
Namespace: default
StorageClass:
Status: Bound
Volume: nfs-pv
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 1000Gi
Access Modes: RWX
VolumeMode: Filesystem
Mounted By: ...
- Kubernetes 版本: 1.16.15-gke.500
- 普罗米修斯版本:2.21.0
- 普罗米修斯 Helm Chart: https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus
【问题讨论】:
-
我发现了这个known issue on github,可能类似。如果用例相似,我建议您在此处发布。
标签: kubernetes google-compute-engine prometheus nfs kubernetes-pvc