mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #108550 from dims/specify-journald-configuration-explicitly
Explicitly specify journald config so the kube-up deployed nodes retain logs
This commit is contained in:
commit
debd461d03
@ -505,6 +505,20 @@ function ensure-local-ssds-ephemeral-storage() {
|
|||||||
safe-bind-mount "${ephemeral_mountpoint}/log_pods" "/var/log/pods"
|
safe-bind-mount "${ephemeral_mountpoint}/log_pods" "/var/log/pods"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# set journald configuration
|
||||||
|
function setup-journald() {
|
||||||
|
if [[ "${SET_JOURNALD_CONFIGURATION:-true}" = "true" ]]; then
|
||||||
|
cat <<EOF > /etc/systemd/journald.conf
|
||||||
|
[Journal]
|
||||||
|
Storage=persistent
|
||||||
|
SystemMaxUse=1G
|
||||||
|
SystemMaxFileSize=100M
|
||||||
|
RuntimeMaxUse=100M
|
||||||
|
EOF
|
||||||
|
systemctl restart systemd-journald.service
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Installs logrotate configuration files
|
# Installs logrotate configuration files
|
||||||
function setup-logrotate() {
|
function setup-logrotate() {
|
||||||
mkdir -p /etc/logrotate.d/
|
mkdir -p /etc/logrotate.d/
|
||||||
@ -3410,6 +3424,7 @@ function main() {
|
|||||||
log-wrap 'CreateDirs' create-dirs
|
log-wrap 'CreateDirs' create-dirs
|
||||||
log-wrap 'EnsureLocalSSDs' ensure-local-ssds
|
log-wrap 'EnsureLocalSSDs' ensure-local-ssds
|
||||||
log-wrap 'SetupKubeletDir' setup-kubelet-dir
|
log-wrap 'SetupKubeletDir' setup-kubelet-dir
|
||||||
|
log-wrap 'SetupJournald' setup-journald
|
||||||
log-wrap 'SetupLogrotate' setup-logrotate
|
log-wrap 'SetupLogrotate' setup-logrotate
|
||||||
if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
|
if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
|
||||||
log-wrap 'MountMasterPD' mount-master-pd
|
log-wrap 'MountMasterPD' mount-master-pd
|
||||||
|
Loading…
Reference in New Issue
Block a user