Replies: 11 comments 3 replies
-
In my testing, it doesn't look like supervise-daemon supports the |
Beta Was this translation helpful? Give feedback.
-
I see there is already a logrotate config file, but crond is not started on boot. Is that by design or just a miss? |
Beta Was this translation helpful? Give feedback.
-
@agelwarg probably an intentional miss in that a |
Beta Was this translation helpful? Give feedback.
-
My workaround solution to this is as follows:
|
Beta Was this translation helpful? Give feedback.
-
hi @philipsparrow, thanks for the workaround. My logfile was around 8GB and brought my test cluster down. |
Beta Was this translation helpful? Give feedback.
-
Confirmed that log rotation is able to be done as starting run_cmd:
- "service crond start" Also, found that a default config file
write_files:
- content: |-
/var/log/k3s-service.log {
su root root
maxsize 10M
missingok
notifempty
copytruncate
}
owner: root
path: /etc/logrotate.d/k3s-service-log
permissions: "0644" |
Beta Was this translation helpful? Give feedback.
-
I'm unable to change
I can confirm that the command runs as part of the boot but the file is overwritten after it is changed:
The above will create |
Beta Was this translation helpful? Give feedback.
-
I just figured out that the logrotate config file for k3s-service is being created by the k3s install script. This overwrites anything we do in run_cmd, boot_cmd or write_files. We would need to do something that runs completely after everything (which I thought boot_cmd was, but seems I was wrong). The daemonset approach is interesting, but not ideal since it requires to run something inside the cluster. If the cluster itself is broken and k3s is crashing in loop, the k3s log file will become huge and not get rotated because the logrotate config was not updated by the daemonset. One way to fix this would be to change the default logrotate config, but that affects all log files so it's not ideal. |
Beta Was this translation helpful? Give feedback.
-
That ... really sounds like an annoying deal, I'm sorry. However, if the service-specific configs in the
See also
Agreed. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response @dweomer. I can confirm that it works using a startup script inside /etc/init.d/local. Very appreciated :) |
Beta Was this translation helpful? Give feedback.
-
It would be great if we could come up with a setup for
The funny thing is, the Unfortunately, when the k3s
This leaves That said, I suppose if you use |
Beta Was this translation helpful? Give feedback.
-
During testing, we recently discovered this bug in k3s:
k3s-io/k3s#1628
As a side effect, the k3s log at /var/log/k3s-service.log is growing large very quickly. This bug is one problem, but there could be others or just normal growth to fill the filesystem over time. On a system with constrained storage, this is problematic. To protect against this, it would be nice to include log rotation in some form. Maybe it makes sense just to use syslog?
Beta Was this translation helpful? Give feedback.
All reactions