Commit 773dbde0 authored by Michael Taufen's avatar Michael Taufen

Collect logs for dead kubelets too

Collect logs via journalctl if journalctl is installed, rather than only if kubelet.service is running. The old way resulted in us losing logs any time the kubelet was failing. This, of course, breaks on a node if someone decided to install journalctl but not use it. But that is not the case on any of the images used by cluster-level tests at present.
parent 85ff5559
......@@ -131,7 +131,7 @@ function save-logs() {
esac
fi
if log-dump-ssh "${node_name}" "sudo systemctl status kubelet.service" &> /dev/null; then
if log-dump-ssh "${node_name}" "command -v journalctl" &> /dev/null; then
log-dump-ssh "${node_name}" "sudo journalctl --output=short-precise -u kube-node-installation.service" > "${dir}/kube-node-installation.log" || true
log-dump-ssh "${node_name}" "sudo journalctl --output=short-precise -u kube-node-configuration.service" > "${dir}/kube-node-configuration.log" || true
log-dump-ssh "${node_name}" "sudo journalctl --output=cat -u kubelet.service" > "${dir}/kubelet.log" || true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment