Minikube 日志轮转

Minikube log rotation

我已经阅读了 kubernetes 和 minikube 文档,如果 minikube 实现支持自动日志轮换,这并不明确(定期删除 pod 日志)以防止内存过载通过日志。

我说的不是用于收集、持久化和分析日志的各种集中式日志堆栈,而是 minikube 的标准 pod 日志管理。

在kubernetes官方文档中指定:

An important consideration in node-level logging is implementing log rotation, so that logs don’t consume all available storage on the node. Kubernetes currently is not responsible for rotating logs, but rather a deployment tool should set up a solution to address that. For example, in Kubernetes clusters, deployed by the kube-up.sh script, there is a logrotate tool configured to run each hour. You can also set up a container runtime to rotate application’s logs automatically, for example by using Docker’s log-opt. In the kube-up.sh script, the latter approach is used for COS image on GCP, and the former approach is used in any other environment. In both cases, by default rotation is configured to take place when log file exceeds 10MB.

当然,如果我们不在 GCP 中并且我们不使用 kube-up.sh 来启动集群(或者我们不使用 Docker 作为容器工具)但是我们旋转使用 Minikube 启动我们的集群会发生什么?

根据实施

Minikube now uses systemd which has built in log rotation

参考这个issue