Matteo Scandolo | d82d1de | 2021-04-06 14:55:58 -0700 | [diff] [blame] | 1 | // 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 |
| 3 | def call(String dest) { |
| 4 | sh """ |
| 5 | mkdir -p ${dest} |
Matteo Scandolo | 8b62af3 | 2021-05-25 08:41:12 -0700 | [diff] [blame] | 6 | # only tee the main infos |
Matteo Scandolo | d82d1de | 2021-04-06 14:55:58 -0700 | [diff] [blame] | 7 | kubectl get pods --all-namespaces -o wide | tee ${dest}/pods.txt || true |
Matteo Scandolo | 8b62af3 | 2021-05-25 08:41:12 -0700 | [diff] [blame] | 8 | 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 Scandolo | d82d1de | 2021-04-06 14:55:58 -0700 | [diff] [blame] | 15 | 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 Scandolo | d82d1de | 2021-04-06 14:55:58 -0700 | [diff] [blame] | 17 | """ |
| 18 | } |