Skip to content

Commit

Permalink
Merge pull request #16906 from justinsb/bare_metal_dump_Logs
Browse files Browse the repository at this point in the history
test: dump logs from pods in bare-metal test
  • Loading branch information
k8s-ci-robot authored Oct 14, 2024
2 parents 67909f6 + 222ad69 commit 2ae6fd7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/e2e/scenarios/bare-metal/dump-artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ for vm in 0 1 2; do
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
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
done

# Dump the pod logs for all the pods in system namespaces
for ns in kube-system; do
mkdir -p ${ARTIFACTS}/logs/${ns}/
for pod in $(kubectl get pods -n ${ns} -o json | jq -r '.items[].metadata.name'); do
kubectl logs -n ${ns} ${pod} > ${ARTIFACTS}/logs/${ns}/${pod}.log || true
done
done

0 comments on commit 2ae6fd7

Please sign in to comment.