kubernetes-增加kubectl日志大小
我使用Azure Kubernetes Service(AKS)在Kubernetes托管的Docker容器中运行一个应用程序。我可以使用以下方式将日志输出到文本文件以进行应用程序部署:
kubectl logs deployment/my-deployment > out.txt
这使我的文件约为28MB。当我使用docker日志...
在物理VM上获取同一容器的Docker日志时,日志文件更大(最高120MB+)。
如何增加部署的可用kubectl日志
的大小?如果此选项有可用是相同的。
/etc/daemon.json
中的docker配置不是kubectl
日志,因为将其设置为50MB。我读过,这是Kubernetes使用的基础码头配置,但事实并非如此,因为我的kubectl
日志被截断为大约28mb。
I have an app running in a kubernetes managed docker container, using Azure Kubernetes Service (AKS). I can output logs to a text file for the app deployment using:
kubectl logs deployment/my-deployment > out.txt
This gives me a file of around max 28Mb. When I get the docker logs for the same container on the physical VM using docker logs ...
, the log file is much bigger (up to 120Mb+).
How can I increase the size of the available kubectl logs
for the deployment? If this option is available, then it would likely be an option that increases the size of the available kubectl logs
for the pod that holds the container, as the pod and deployment logs are identical.
It's not the docker configuration in /etc/docker/daemon.json
that's limiting the kubectl
logs, as that's set to 50Mb. I've read that it's the underlying docker configuration that kubernetes uses, but that doesn't seem to be the case, as mykubectl
logs are being truncated to around 28Mb.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
kubectl logs
可能会读取日志通过默认日志旋转,意味着 logrotate服务处于活动状态。
检查cat /etc/logrotate.d/docker-containers的内容,如 a>,用于确认。
如
unofficial-kubernetes
:Kubectl logs
might read logs with a default log rotation, meaning the logrotate service is active.Check the content of cat /etc/logrotate.d/docker-containers, as in this issue, for confirmation.
As explained in
unofficial-kubernetes
: