#!/bin/bash # default pod status out1=$(/usr/bin/kubectl get pods -o custom-columns="NAME":.metadata.name,"STATUS":.status.phase,"NODE":.spec.nodeName,"POD-IP":.status.podIP,"SOURCE":.metadata.ownerReferences[0].kind) out2=$(kubectl get pods) join <(echo "$out1") <(echo "$out2") | awk '{print $1, $6, $2, $3, $4, $5 }' | sed 's/\.thekyel.com//g' | column -t echo "" # node status /usr/bin/kubectl get nodes -o custom-columns="NAME":.metadata.name,"TAINTS":.spec.taints[*].effect,"STATUS":.status.conditions[4].type,"IP":.status.addresses[0].address,"ARCH":.status.nodeInfo.architecture | sed 's/\.thekyel.com//g' | column -t echo "" # problematic non-default pod status echo "problematic non-default pods (none if output is empty):" /usr/bin/kubectl get pods -A | grep -vE "default" | grep -vE "1/1 Running" | column -t