categraf deamonset方式部署(腾讯云主机/data目录挂了单独的磁盘),采集磁盘使用率报如下错误:
2023/04/06 19:16:40 ps.go:150: E! failed to get disk usage, mountpoint: /hostfs/data error: no such file or directory
请帮忙看看。
categraf deamonset方式部署(腾讯云主机/data目录挂了单独的磁盘),采集磁盘使用率报如下错误:
2023/04/06 19:16:40 ps.go:150: E! failed to get disk usage, mountpoint: /hostfs/data error: no such file or directory
请帮忙看看。
容器里容器外分别执行df -h看看
除了秦老师提到的,检查下
引用
- name: HOST_PROC
value: /hostfs/proc
- name: HOST_SYS
value: /hostfs/sys
- name: HOST_MOUNT_PREFIX
value: /hostfs
这部分都还在daemonset中吗
volume挂载
volumeMounts:
- mountPath: /etc/categraf/conf/config.toml
name:categraf-config
subPath: config.toml
- mountPath: /etc/categraf/conf/input.kubernetes/kubernetes.toml
name:categraf-config-kubernetes
subPath: kubernetes.toml
- mountPath: /etc/categraf/conf/input.prometheus/prometheus.toml
name:categraf-config-prometheus
subPath: prometheus.toml
- mountPath: /var/run/utmp
name: hostroutmp
readOnly: true
- mountPath: /hostfs/proc
name: hostrofs-proc
readOnly: true
- mountPath: /hostfs/sys
name: hostrofs-sys
readOnly: true
- mountPath: /hostfs/var
name: hostrofs-var
readOnly: true
- mountPath: /hostfs/run
name: hostrofs-run
readOnly: true
- mountPath: /hostfs/dev
name: hostrofs-dev
readOnly: true
- mountPath: /var/run/docker.sock
name: docker-socket
step1 这里是定义根目录的volume为hosrofs
https://github.com/flashcatcloud/categraf/blob/main/k8s/daemonset.yaml#L703
step2 将上面定义的hostrofs挂载到容器的/hostfs路径下
https://github.com/flashcatcloud/categraf/blob/main/k8s/daemonset.yaml#L623
step3 告诉categraf 物理机的路径前缀是/hostfs
https://github.com/flashcatcloud/categraf/blob/main/k8s/daemonset.yaml#L579
对着检查下