Skip to content

Commit 1d28e8c

Browse files
authored
Merge pull request kubernetes#88113 from oxddr/log-dump-extra-files
log-dump.sh: allow to dump extra log files
2 parents fc573f9 + c43b940 commit 1d28e8c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

cluster/log-dump/log-dump.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ readonly kern_logfile="kern.log"
5151
readonly initd_logfiles="docker/log"
5252
readonly supervisord_logfiles="kubelet.log supervisor/supervisord.log supervisor/kubelet-stdout.log supervisor/kubelet-stderr.log supervisor/docker-stdout.log supervisor/docker-stderr.log"
5353
readonly systemd_services="kubelet kubelet-monitor kube-container-runtime-monitor ${LOG_DUMP_SYSTEMD_SERVICES:-docker}"
54+
readonly extra_log_files="${LOG_DUMP_EXTRA_FILES:-}"
5455
readonly dump_systemd_journal="${LOG_DUMP_SYSTEMD_JOURNAL:-false}"
5556
# Log files found in WINDOWS_LOGS_DIR on Windows nodes:
5657
readonly windows_node_logfiles="kubelet.log kube-proxy.log docker.log"
@@ -140,6 +141,7 @@ function save-logs() {
140141
local opt_systemd_services="${4:-""}"
141142
local on_master="${5:-"false"}"
142143

144+
files="${files} ${extra_log_files}"
143145
if [[ -n "${use_custom_instance_list}" ]]; then
144146
if [[ -n "${LOG_DUMP_SAVE_LOGS:-}" ]]; then
145147
files="${files} ${LOG_DUMP_SAVE_LOGS:-}"
@@ -474,6 +476,7 @@ function dump_nodes_with_logexporter() {
474476
sed -i'' -e "s@{{.GCSPath}}@${gcs_artifacts_dir}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
475477
sed -i'' -e "s@{{.EnableHollowNodeLogs}}@${enable_hollow_node_logs}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
476478
sed -i'' -e "s@{{.DumpSystemdJournal}}@${dump_systemd_journal}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
479+
sed -i'' -e "s@{{.ExtraLogFiles}}@${extra_log_files}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
477480

478481
# Create the logexporter namespace, service-account secret and the logexporter daemonset within that namespace.
479482
KUBECTL="${KUBE_ROOT}/cluster/kubectl.sh"

cluster/log-dump/logexporter-daemonset.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ spec:
5050
- --gcloud-auth-file-path=/etc/service-account/service-account.json
5151
- --enable-hollow-node-logs={{.EnableHollowNodeLogs}}
5252
- --dump-systemd-journal={{.DumpSystemdJournal}}
53+
- --extra-log-files={{.ExtraLogFiles}}
5354
- --sleep-duration=24h
5455
- --alsologtostderr
5556
volumeMounts:

0 commit comments

Comments
 (0)