Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable env defined services to dump in logexporter #89760

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion cluster/log-dump/log-dump.sh
Expand Up @@ -52,6 +52,7 @@ readonly initd_logfiles="docker/log"
readonly supervisord_logfiles="kubelet.log supervisor/supervisord.log supervisor/kubelet-stdout.log supervisor/kubelet-stderr.log supervisor/docker-stdout.log supervisor/docker-stderr.log"
readonly systemd_services="kubelet kubelet-monitor kube-container-runtime-monitor ${LOG_DUMP_SYSTEMD_SERVICES:-docker}"
readonly extra_log_files="${LOG_DUMP_EXTRA_FILES:-}"
readonly extra_systemd_services="${LOG_DUMP_SAVE_SERVICES:-}"
readonly dump_systemd_journal="${LOG_DUMP_SYSTEMD_JOURNAL:-false}"
# Log files found in WINDOWS_LOGS_DIR on Windows nodes:
readonly windows_node_logfiles="kubelet.log kube-proxy.log docker.log docker_images.log"
Expand Down Expand Up @@ -156,7 +157,7 @@ function save-logs() {
;;
esac
fi
local -r services=( ${systemd_services} ${opt_systemd_services} ${LOG_DUMP_SAVE_SERVICES:-} )
local -r services=( ${systemd_services} ${opt_systemd_services} ${extra_systemd_services} )

if log-dump-ssh "${node_name}" "command -v journalctl" &> /dev/null; then
if [[ "${on_master}" == "true" ]]; then
Expand Down Expand Up @@ -499,6 +500,7 @@ function dump_nodes_with_logexporter() {
sed -i'' -e "s@{{.EnableHollowNodeLogs}}@${enable_hollow_node_logs}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
sed -i'' -e "s@{{.DumpSystemdJournal}}@${dump_systemd_journal}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
sed -i'' -e "s@{{.ExtraLogFiles}}@${extra_log_files}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"
sed -i'' -e "s@{{.ExtraSystemdServices}}@${extra_systemd_services}@g" "${KUBE_ROOT}/cluster/log-dump/logexporter-daemonset.yaml"

# Create the logexporter namespace, service-account secret and the logexporter daemonset within that namespace.
KUBECTL="${KUBE_ROOT}/cluster/kubectl.sh"
Expand Down
3 changes: 2 additions & 1 deletion cluster/log-dump/logexporter-daemonset.yaml
Expand Up @@ -36,7 +36,7 @@ spec:
spec:
containers:
- name: logexporter-test
image: gcr.io/k8s-testimages/logexporter:v20200327-9ba073aa98
image: gcr.io/k8s-testimages/logexporter:v20200401-c3269f485
env:
- name: NODE_NAME
valueFrom:
Expand All @@ -51,6 +51,7 @@ spec:
- --enable-hollow-node-logs={{.EnableHollowNodeLogs}}
- --dump-systemd-journal={{.DumpSystemdJournal}}
- --extra-log-files={{.ExtraLogFiles}}
- --extra-systemd-services={{.ExtraSystemdServices}}
- --sleep-duration=24h
volumeMounts:
- mountPath: /etc/service-account
Expand Down