Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mumoshu opened this issue May 31, 2016 · 1 comment

Comments

@mumoshu
Copy link

mumoshu commented May 31, 2016

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
Copy link

samlevin commented Aug 4, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants