Skip to content

Commit 65daa2a

Browse files
author
Maksym Pavlenko
committed
Document changing pod logs directory in kubelet
Signed-off-by: Maksym Pavlenko <[email protected]>
1 parent fe2efe0 commit 65daa2a

File tree

1 file changed

+18
-2
lines changed
  • content/en/docs/concepts/cluster-administration

1 file changed

+18
-2
lines changed

content/en/docs/concepts/cluster-administration/logging.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ If systemd is not present, the kubelet and container runtime write to `.log` fil
150150
run the kubelet via a helper tool, `kube-log-runner`, and use that tool to redirect
151151
kubelet logs to a directory that you choose.
152152

153-
The kubelet always directs your container runtime to write logs into directories within
153+
By default, kubelet directs your container runtime to write logs into directories within
154154
`/var/log/pods`.
155155

156156
For more information on `kube-log-runner`, read [System Logs](/docs/concepts/cluster-administration/system-logs/#klog).
@@ -168,7 +168,7 @@ If you want to have logs written elsewhere, you can indirectly
168168
run the kubelet via a helper tool, `kube-log-runner`, and use that tool to redirect
169169
kubelet logs to a directory that you choose.
170170

171-
However, the kubelet always directs your container runtime to write logs within the
171+
However, by default, kubelet directs your container runtime to write logs within the
172172
directory `C:\var\log\pods`.
173173

174174
For more information on `kube-log-runner`, read [System Logs](/docs/concepts/cluster-administration/system-logs/#klog).
@@ -182,6 +182,22 @@ the `/var/log` directory, bypassing the default logging mechanism (the component
182182
do not write to the systemd journal). You can use Kubernetes' storage mechanisms
183183
to map persistent storage into the container that runs the component.
184184

185+
Kubelet allows changing the pod logs directory from default `/var/log/pods`
186+
to a custom path. This adjustment can be made by configuring the `podLogsDir`
187+
parameter in the kubelet's configuration file.
188+
189+
{{< caution >}}
190+
It's important to note that the default location `/var/log/pods` has been in use for
191+
an extended period and certain processes might implicitly assume this path.
192+
Therefore, altering this parameter must be approached with caution and at your own risk.
193+
194+
Another caveat to keep in mind is that the kubelet supports the location being on the same
195+
disk as `/var`. Otherwise, if the logs are on a separate filesystem from `/var`,
196+
then the kubelet will not track that filesystem's usage, potentially leading to issues if
197+
it fills up.
198+
199+
{{< /caution >}}
200+
185201
For details about etcd and its logs, view the [etcd documentation](https://etcd.io/docs/).
186202
Again, you can use Kubernetes' storage mechanisms to map persistent storage into
187203
the container that runs the component.

0 commit comments

Comments
 (0)