Skip to content

Commit 2ae6fd7

Browse files
authored
Merge pull request #16906 from justinsb/bare_metal_dump_Logs
test: dump logs from pods in bare-metal test
2 parents 67909f6 + 222ad69 commit 2ae6fd7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/e2e/scenarios/bare-metal/dump-artifacts

+8
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,11 @@ for vm in 0 1 2; do
5757
ssh -o StrictHostKeyChecking=accept-new -i ${REPO_ROOT}/.build/.ssh/id_ed25519 root@${ip} journalctl --no-pager -u kubelet 2>&1 > ${ARTIFACTS}/vms/${vm_name}/logs/kubelet.service || true
5858
ssh -o StrictHostKeyChecking=accept-new -i ${REPO_ROOT}/.build/.ssh/id_ed25519 root@${ip} journalctl --no-pager -u kops-configuration 2>&1 > ${ARTIFACTS}/vms/${vm_name}/logs/kops-configuration.service || true
5959
done
60+
61+
# Dump the pod logs for all the pods in system namespaces
62+
for ns in kube-system; do
63+
mkdir -p ${ARTIFACTS}/logs/${ns}/
64+
for pod in $(kubectl get pods -n ${ns} -o json | jq -r '.items[].metadata.name'); do
65+
kubectl logs -n ${ns} ${pod} > ${ARTIFACTS}/logs/${ns}/${pod}.log || true
66+
done
67+
done

0 commit comments

Comments
 (0)