From 7b5c718946dc536e3f173123836a7f48de8ecb97 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Sun, 6 Mar 2022 16:41:12 -0500 Subject: [PATCH] explicitly specify journald config Signed-off-by: Davanum Srinivas --- cluster/gce/gci/configure-helper.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 4483fbde114..82ac4b5771f 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -505,6 +505,20 @@ function ensure-local-ssds-ephemeral-storage() { safe-bind-mount "${ephemeral_mountpoint}/log_pods" "/var/log/pods" } +# set journald configuration +function setup-journald() { + if [[ "${SET_JOURNALD_CONFIGURATION:-true}" = "true" ]]; then + cat < /etc/systemd/journald.conf +[Journal] +Storage=persistent +SystemMaxUse=1G +SystemMaxFileSize=100M +RuntimeMaxUse=100M +EOF + systemctl restart systemd-journald.service + fi +} + # Installs logrotate configuration files function setup-logrotate() { mkdir -p /etc/logrotate.d/ @@ -3410,6 +3424,7 @@ function main() { log-wrap 'CreateDirs' create-dirs log-wrap 'EnsureLocalSSDs' ensure-local-ssds log-wrap 'SetupKubeletDir' setup-kubelet-dir + log-wrap 'SetupJournald' setup-journald log-wrap 'SetupLogrotate' setup-logrotate if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then log-wrap 'MountMasterPD' mount-master-pd