Skip to content

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

@mumoshu

Description

@mumoshu

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions