看起来 journald pod 日志记录('kubectl logs' 命令)不适用于 kubernetes v1.18.x。有没有办法让它与 v1.18.x 一起工作?我已经设置了一个多节点集群,将 docker 日志驱动程序作为“journald”(使用 /etc/docker/daemon.json)并使用带有拉取方法的 systemd-journal-gatewayd 来聚合历史日志。但是,我对能够使用 'kubectl logs' 或 'kubectl logs -l 'app=label' --prefix -f' (对于集群范围的日志)来跟踪当前日志非常感兴趣。
# kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
# docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:20:16 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:23:58 2018
OS/Arch: linux/amd64
Experimental: false
# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
运行“kubectl logs”会出现以下错误:
# kubectl logs <pod-name>
failed to try resolving symlinks in path "/var/log/pods/default_<pod-name>_xxxx/<container-name>/0.log": lstat /var/log/pods/default_<pod-name>_xxxx/<container-name>/0.log: no such file or directory