From 7f89a9d34068cae28636a3cb6e90d12da6d63e43 Mon Sep 17 00:00:00 2001 From: Praveen Kumar Date: Thu, 21 Mar 2024 13:04:43 +0530 Subject: [PATCH] Add kubelet config file to update containerLogMaxSize and containerLogMaxFiles setting By default log size is set to 50Mi and number of log file is set to 5 but for local developement we might not need those setting where disk space is also critical. In this PR we are changing it to 5Mi and 2 respectivily. During the testing (generation of 4.15.3 bundle) I can see reduction of ~ 200 MB to final bundle size. --- 99-kubelet-log-size-config.yaml | 11 +++++++++++ snc.sh | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 99-kubelet-log-size-config.yaml diff --git a/99-kubelet-log-size-config.yaml b/99-kubelet-log-size-config.yaml new file mode 100644 index 00000000..36e5ad6c --- /dev/null +++ b/99-kubelet-log-size-config.yaml @@ -0,0 +1,11 @@ +apiVersion: machineconfiguration.openshift.io/v1 +kind: KubeletConfig +metadata: + name: container-logs-limit +spec: + machineConfigPoolSelector: + matchLabels: + pools.operator.machineconfiguration.openshift.io/master: "" + kubeletConfig: + containerLogMaxSize: "2Mi" + containerLogMaxFiles: "2" diff --git a/snc.sh b/snc.sh index 5e9be3b3..0e6ecb41 100755 --- a/snc.sh +++ b/snc.sh @@ -147,6 +147,8 @@ cp cluster-network-03-config.yaml ${INSTALL_DIR}/manifests/ cp 99_master-chronyd-mask.yaml $INSTALL_DIR/openshift/ # Add dummy network unit file cp 99-openshift-machineconfig-master-dummy-networks.yaml $INSTALL_DIR/openshift/ +# Add kubelet config to have 5MiB log size instead 50MiB and 2 log files instead 5 +cp 99-kubelet-log-size-config.yaml $INSTALL_DIR/openshift/ # Add kubelet config resource to make change in kubelet DYNAMIC_DATA=$(base64 -w0 node-sizing-enabled.env) envsubst < 99_master-node-sizing-enabled-env.yaml.in > $INSTALL_DIR/openshift/99_master-node-sizing-enabled-env.yaml # Add codeReadyContainer as invoker to identify it with telemeter