blob: 03b17ce97e5a71d176f22981715d738787f0120b [file] [log] [blame]
Matteo Scandolod82d1de2021-04-06 14:55:58 -07001// This keyword will get all the kubernetes pods info needed for debugging
2// the only parameter required is the destination folder to store the collected information
3def call(String dest) {
4 sh """
5 mkdir -p ${dest}
Matteo Scandolo8b62af32021-05-25 08:41:12 -07006 # only tee the main infos
Matteo Scandolod82d1de2021-04-06 14:55:58 -07007 kubectl get pods --all-namespaces -o wide | tee ${dest}/pods.txt || true
Matteo Scandolo8b62af32021-05-25 08:41:12 -07008 helm ls --all-namespaces | tee ${dest}/helm-charts.txt
9
10 # everything else should not be dumped on the console
11 kubectl get svc --all-namespaces -o wide > ${dest}/svc.txt || true
12 kubectl get pvc --all-namespaces -o wide > ${dest}/pvcs.txt || true
13 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.image}{'\\n'}" | sort | uniq > ${dest}/pod-images.txt || true
14 kubectl get pods --all-namespaces -o jsonpath="{range .items[*].status.containerStatuses[*]}{.imageID}{'\\n'}" | sort | uniq > ${dest}/pod-imagesId.txt || true
Matteo Scandolod82d1de2021-04-06 14:55:58 -070015 kubectl describe pods --all-namespaces -l app.kubernetes.io/part-of=voltha > ${dest}/voltha-pods-describe.txt
16 kubectl describe pods --all-namespaces -l app=onos-classic > ${dest}/onos-pods-describe.txt
Matteo Scandolod82d1de2021-04-06 14:55:58 -070017 """
18}