Collect k8s data on post job
Change-Id: Iee1be3ed424e76645ec0606cd33bee5f8a47a569
This commit is contained in:
parent
2ce041d884
commit
c4e0bb20ce
|
@ -25,7 +25,10 @@ copy_logs() {
|
|||
cp -rvnL $HOME/.ansible/* ${LOG_DIR}/ansible/
|
||||
fi
|
||||
|
||||
# Backup etc
|
||||
cp -rvnL /etc ${LOG_DIR}/
|
||||
cp /etc/sudoers ${LOG_DIR}/etc/sudoers.txt
|
||||
|
||||
cp -rvnL /var/log/* ${LOG_DIR}/system_logs/
|
||||
cp -rvnL /tmp/kubespray ${LOG_DIR}/
|
||||
|
||||
|
@ -37,9 +40,6 @@ copy_logs() {
|
|||
cp /var/log/upstart/docker.log ${LOG_DIR}/system_logs/docker.log
|
||||
fi
|
||||
|
||||
cp -r /etc/sudoers.d ${LOG_DIR}/system_logs/
|
||||
cp /etc/sudoers ${LOG_DIR}/system_logs/sudoers.txt
|
||||
|
||||
df -h > ${LOG_DIR}/system_logs/df.txt
|
||||
free > ${LOG_DIR}/system_logs/free.txt
|
||||
parted -l > ${LOG_DIR}/system_logs/parted-l.txt
|
||||
|
@ -65,6 +65,16 @@ copy_logs() {
|
|||
done
|
||||
fi
|
||||
|
||||
|
||||
if [ `command -v kubectl` ]; then
|
||||
if [ `command -v oc` ]; then
|
||||
oc login -u system:admin
|
||||
fi
|
||||
|
||||
(kubectl version && kubectl cluster-info dump && kubectl config view) > ${LOG_DIR}/system_logs/k8s-info.txt 2>&1
|
||||
kubectl describe all --all-namespaces > ${LOG_DIR}/system_logs/k8s-describe-all.txt 2>&1
|
||||
fi
|
||||
|
||||
# Rename files to .txt; this is so that when displayed via
|
||||
# logs.openstack.org clicking results in the browser shows the
|
||||
# files, rather than trying to send it to another app or make you
|
||||
|
|
Loading…
Reference in New Issue