From 1da5ea7a9561b0ba92b937c992f672499869698d Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Thu, 22 Jun 2017 14:58:57 -0500 Subject: [PATCH] Zuul logging: get descriptions of k8s objects running in gates This ps adds descriptive logging of all k8s objects running in the Zuul gates. Change-Id: Id44b085f2e49bb89b0dd1d0d8444af0aa1265ed4 --- tools/gate/dump_logs.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/gate/dump_logs.sh b/tools/gate/dump_logs.sh index 4bc89413c4..27a5c6045c 100755 --- a/tools/gate/dump_logs.sh +++ b/tools/gate/dump_logs.sh @@ -61,6 +61,16 @@ for OBJECT_TYPE in clusterroles \ kubectl get ${OBJECT_TYPE} -o yaml > ${LOGS_DIR}/k8s/rbac/${OBJECT_TYPE}.yaml done +mkdir -p ${LOGS_DIR}/k8s/descriptions +for NAMESPACE in $(kubectl get namespaces -o name | awk -F '/' '{ print $NF }') ; do + for OBJECT in $(kubectl get all --show-all -n $NAMESPACE -o name) ; do + OBJECT_TYPE=$(echo $OBJECT | awk -F '/' '{ print $1 }') + OBJECT_NAME=$(echo $OBJECT | awk -F '/' '{ print $2 }') + mkdir -p ${LOGS_DIR}/k8s/descriptions/${NAMESPACE}/${OBJECT_TYPE} + kubectl describe -n $NAMESPACE $OBJECT > ${LOGS_DIR}/k8s/descriptions/${NAMESPACE}/$OBJECT_TYPE/$OBJECT_NAME.txt + done +done + mkdir -p ${LOGS_DIR}/nodes/$(hostname) sudo iptables-save > ${LOGS_DIR}/nodes/$(hostname)/iptables.txt sudo ip a > ${LOGS_DIR}/nodes/$(hostname)/ip.txt