github.com/pachyderm/pachyderm@v1.13.4/etc/testing/kube_debug.sh (about)

     1  #!/bin/bash
     2  
     3  echo "=== TEST FAILED OR TIMED OUT, DUMPING DEBUG INFO ==="
     4  
     5  export GOPATH=/root/go
     6  export PATH="${GOPATH}/bin:${PATH}"
     7  
     8  # TODO: Extend this to show kubectl describe output for failed pods, this will
     9  # probably show why things are hanging.
    10  
    11  # SC2016 blocks variables in single-quoted strings, but these are 'eval'ed below
    12  # shellcheck disable=SC2016
    13  cmds=(
    14    'pachctl version'
    15    'pachctl list repo'
    16    'pachctl list repo --raw | jq -r ".repo.name" | while read r; do
    17       echo "---";
    18       pachctl inspect repo "${r}";
    19       echo "Commits:";
    20       pachctl list commit "${r}";
    21       echo;
    22     done'
    23    'pachctl list pipeline'
    24    'pachctl list job'
    25    'kubectl version'
    26    'kubectl get all --all-namespaces'
    27    'kubectl describe pod -l suite=pachyderm,app=pachd'
    28    'kubectl describe pod -l suite=pachyderm,app=etcd'
    29    # Set --tail b/c by default 'kubectl logs' only outputs 10 lines if -l is set
    30    'kubectl logs --tail=500 -l suite=pachyderm,app=pachd'
    31    'kubectl logs --tail=1000 -l suite=pachyderm,app=pachd --previous # if pachd restarted'
    32    'sudo dmesg | tail -n 40'
    33    'minikube logs | tail -n 100'
    34    'top -b -n 1 | head -n 40'
    35    'df -h'
    36  )
    37  for c in "${cmds[@]}"; do
    38    echo "======================================================================"
    39    echo "${c}"
    40    echo "----------------------------------------------------------------------"
    41    eval "${c}"
    42  done
    43  echo "======================================================================"