kubelet 报错: Orphaned pod found - but volume paths are still present on disk

本文解决了一个常见的Kubernetes问题,即孤儿Pod在kubelet目录中留下残留的volume路径,导致日志错误。通过检查etc-hosts文件找到Pod名称,手动删除遗留的Pod目录,最终解决了日志持续刷屏的问题。
kubelet_volumes.go:128] Orphaned pod "86d60ee9-9fae-11e8-8cfc-525400290b20" found, but volume paths are still present on disk. : There were a total of 1 errors similar to this.  Turn up verbosity to see them.
kubelet_volumes.go:128] Orphaned pod "86d60ee9-9fae-11e8-8cfc-525400290b20" found, but volume paths are still present on disk. : There were a total of 1 errors similar to this.  Turn up verbosity to see them.
kubelet_volumes.go:128] Orphaned pod "86d60ee9-9fae-11e8-8cfc-525400290b20" found, but volume paths are still present on disk. : There were a total of 1 errors similar to this.  Turn up verbosity to see them.

通过id号,进入kubelet的目录,可以发现里面装的是容器的数据,etc-hosts文件中还保留着podname。

# cd /var/lib/kubelet/pods/86d60ee9-9fae-11e8-8cfc-525400290b20

/var/lib/kubelet/pods/86d60ee9-9fae-11e8-8cfc-525400290b20# ls
containers  etc-hosts  plugins  volumes

/var/lib/kubelet/pods/86d60ee9-9fae-11e8-8cfc-525400290b20# cat etc-hosts 
# Kubernetes-managed hosts file.
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
fe00::0	ip6-mcastprefix
fe00::1	ip6-allnodes
fe00::2	ip6-allrouters
172.16.1.180	omc-test-2509590746-mw56s

解决问题

首先通过etc-hosts文件的pod name 发现已经没有相关的实例在运行了,然后按照issue中的提示,删除pod

rm -rf 86d60ee9-9fae-11e8-8cfc-525400290b20

但是这个方法有一定的危险性,还不确认是否有数据丢失的风险,如果可以确认,再执行。或在issue中寻找更好的解决方法。

再去查看日志,就会发现syslog不会再刷类似的日志了。

参考:https://cloud.tencent.com/developer/article/1385911

@郭川磊 节点message中发现了以下日志 Nov 27 03:50:09 instance-tlx3n3o5-04 kubelet: E1127 03:50:09.178611 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:11 instance-tlx3n3o5-04 kubelet: E1127 03:50:11.179145 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:13 instance-tlx3n3o5-04 kubelet: E1127 03:50:13.179505 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:15 instance-tlx3n3o5-04 kubelet: E1127 03:50:15.178549 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:17 instance-tlx3n3o5-04 kubelet: E1127 03:50:17.179662 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:19 instance-tlx3n3o5-04 kubelet: E1127 03:50:19.178592 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:21 instance-tlx3n3o5-04 kubelet: E1127 03:50:21.179354 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:23 instance-tlx3n3o5-04 kubelet: E1127 03:50:23.178330 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:25 instance-tlx3n3o5-04 kubelet: E1127 03:50:25.178940 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:27 instance-tlx3n3o5-04 kubelet: E1127 03:50:27.179081 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:29 instance-tlx3n3o5-04 kubelet: E1127 03:50:29.179352 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:31 instance-tlx3n3o5-04 kubelet: E1127 03:50:31.178735 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:33 instance-tlx3n3o5-04 kubelet: E1127 03:50:33.179198 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:35 instance-tlx3n3o5-04 kubelet: E1127 03:50:35.179392 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:37 instance-tlx3n3o5-04 kubelet: E1127 03:50:37.178201 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:39 instance-tlx3n3o5-04 kubelet: E1127 03:50:39.178448 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:41 instance-tlx3n3o5-04 kubelet: E1127 03:50:41.178875 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them. Nov 27 03:50:43 instance-tlx3n3o5-04 kubelet: E1127 03:50:43.179405 123978 kubelet_volumes.go:179] orphaned pod "0cf50d7a-69c3-487c-9c66-8f04480f2a30" found, but failed to rmdir() volume at path /cce/kubelet/pods/0cf50d7a-69c3-487c-9c66-8f04480f2a30/volumes/kubernetes.io~empty-dir/engine-data: directory not empty : There were a total of 10 errors similar to this. Turn up verbosity to see them.
最新发布
12-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值