redspread / localkube

DEPRECRATED - See https://github.com/kubernetes/minikube
Apache License 2.0
184 stars 11 forks source link

/var/log must be mounted by localkube in order to allow cluster level logging #65

Open mumoshu opened 8 years ago

mumoshu commented 8 years ago

Hi, thanks for sharing this great OSS :)

I have recently tested cluster logging as described in http://kubernetes.io/docs/getting-started-guides/logging/ with localkube and unfortunately I couldn't make fluentd collect any log or send it. After some debugging, I have realized that my fluentd pods were unable to find any kubernetes related log under /var/log which kubelet/localkube is expected to write kubernetes(/var/log/*.log) and its pods' logs(/var/log/containers/*.log) to.

I believe that we can make localkube mount /var/log to allow fluentd collect logs from localkube/kubelet.

More concretely, with the following change and running localkube via make run-image, I have confirmed that fluentd can do the job:

--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ DOCKER_DIR := /go/src/$(PKG)

 MNT_ROOT ?= -v "/:/rootfs:ro"
 MNT_SYS ?= -v "/sys:/sys:rw"
-MNT_DOCKER_LIB ?= -v "/var/lib/docker:/var/lib/docker" -v "/mnt/sda1/var/lib/docker:/mnt/sda1/var/lib/docker"
+MNT_DOCKER_LIB ?= -v "/var/lib/docker:/var/lib/docker" -v "/mnt/sda1/var/lib/docker:/mnt/sda1/var/lib/docker" -v "/var/log:/var/log"
 MNT_KUBELET_LIB ?= -v "/var/lib/kubelet:/var/lib/kubelet"
 MNT_RUN ?= -v "/var/run:/var/run:rw"

Has anyone encountered this issue, too? Could you share your experience e.g. how you had resolved the issue (w/ the same fix as I had done or another way?)

samlevin commented 8 years ago

Is this built into minikube now? Can I automatically populate /var/log/containers/*.log with the latest version of minikube?

Minikube has been fantastic so far but this is the only thing that I've not been able to figure out. I'm using the vagrant provider with two VMs now in the meantime, which uses considerably more resources than minikube.