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

Add /var/log/pods and /var/log/containers to the mount points for kubelet #169

Closed
galal-hussein opened this issue Dec 19, 2017 · 1 comment
Assignees
Labels

Comments

@galal-hussein
Copy link
Contributor

Both mount points:

  • /var/log/pods
  • /var/log/containers
    should be mounted within kubelet to be able to track the pods logs using tools like fluentd.
@soumyalj
Copy link

soumyalj commented Jan 5, 2018

Tested with rke version v0.0.9-dev. Each host has directories /var/log/pods and /var/log/containers.
It was verified that the directories have data for both system and user level pods.

root@soumyarketest-02:/var/log/pods# ls -ltr
total 16
drwxr-xr-x 2 root root 4096 Jan  5 23:29 45eb687f-f270-11e7-a23e-5ab0d5506cd4
drwxr-xr-x 2 root root 4096 Jan  5 23:29 487d3d53-f270-11e7-a23e-5ab0d5506cd4
drwxr-xr-x 2 root root 4096 Jan  5 23:31 8f638d84-f270-11e7-a23e-5ab0d5506cd4
drwxr-xr-x 2 root root 4096 Jan  5 23:54 c3c323a0-f273-11e7-a23e-5ab0d5506cd4
root@soumyarketest-02:/var/log/pods# cd c3c323a0-f273-11e7-a23e-5ab0d5506cd4/
root@soumyarketest-02:/var/log/pods/c3c323a0-f273-11e7-a23e-5ab0d5506cd4# ls
testcontainer_0.log
root@soumyarketest-02:/var/log/pods/c3c323a0-f273-11e7-a23e-5ab0d5506cd4# cat testcontainer_0.log 
{"log":"1:C 05 Jan 23:54:34.785 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo\r\n","stream":"stdout","time":"2018-01-05T23:54:34.790996857Z"}
{"log":"1:C 05 Jan 23:54:34.785 # Redis version=4.0.6, bits=64, commit=00000000, modified=0, pid=1, just started\r\n","stream":"stdout","time":"2018-01-05T23:54:34.791029782Z"}
{"log":"1:C 05 Jan 23:54:34.785 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf\r\n","stream":"stdout","time":"2018-01-05T23:54:34.791077597Z"}
root@soumyarketest-02:/var/log/containers# ls
k8testrc1-h77pt_default_testcontainer-db26b73d01fe53309faf4b6e85bc0d701a6b9f6fdd65832b4c5eac8449e91c2f.log
k8testrc3-zf278_default_testcontainer-7c2d541af30ff644f0bb2876b8bd7705b0d6d55159371938a0e62d129c3abb32.log
kube-dns-autoscaler-5cb4f55974-n6kjt_kube-system_autoscaler-a38783c25b8ae24e317e31a978a060597ba3a26153c80801189183fc85377964.log
kube-flannel-ckg85_kube-system_install-cni-e8683cb143ab944f7183c2b26df99f3a47b5a73762f7cd52a32d0c37db6e872a.log
kube-flannel-ckg85_kube-system_kube-flannel-a93519cf24ca2b1e522f127e6099e01001bf00285da6b441bbd15a855587a610.log


@soumyalj soumyalj closed this as completed Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants