Tencent / caelus

Set of Kubernetes solutions for reusing idle resources of nodes by running extra batch jobs
Other
344 stars 83 forks source link

在容器中往/rootfs/etc写文件,报:Read-only file system #50

Open silenceper opened 2 years ago

silenceper commented 2 years ago

https://github.com/Tencent/caelus/blob/27d65d540ac918a78d5dc350e7b2ed035e7be485/pkg/caelus/diskquota/manager/projectquota/projectfile.go#L50-L53 看已经直接挂载/etc/进入容器中,这里是否可以不需要了?

ddongchen commented 2 years ago

@silenceper 目前看确实是可以的。但/etc挂载是因为cadvisor在容器里运行需要,不是为diskquota单独配置的。

silenceper commented 2 years ago

@ddongchen 我这边设置diskquota,看log写入/rootfs/etc/ 的一个temp文件遇到Read-only file system导致无法写入/rootfs/etc/projects的错误,确认下是否有这个问题?

ddongchen commented 2 years ago

@silenceper 确实有这个问题,因/rootfs挂载为readonly模式。像您说的,因/etc已挂载,可直接操作/etc/projects即可。

silenceper commented 2 years ago

还有个问题,这两个文件 "/etc/projects", "/etc/projid"的内容完全由caelus来写入,而不是追加的形式,看到只在实例化的时候执行了一次DumpProjectIds,后续非caelus进程写入的信息,内容是不是会丢失?