From 625ec529ffd043b9f36421d8e356c96274ca82d0 Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 14 Nov 2016 17:09:52 +0100 Subject: [PATCH] Fix collect_info script Fix missing journal ctl utc key. Rework kube* logs collection. Signed-off-by: Bogdan Dobrelya --- scripts/collect-info.yaml | 49 ++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/scripts/collect-info.yaml b/scripts/collect-info.yaml index 0ba47866e..6501da995 100644 --- a/scripts/collect-info.yaml +++ b/scripts/collect-info.yaml @@ -22,40 +22,40 @@ - name: k8s_info cmd: kubectl get all --all-namespaces -o wide - name: errors_info - cmd: journalctl -p err --utc --no-pager + cmd: journalctl -p err --no-pager - name: etcd_info cmd: etcdctl --debug cluster-health - name: weave_info cmd: weave report | jq "." - name: weave_logs - cmd: docker logs weave > weave.log + cmd: docker logs weave - name: kubedns_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kubedns -o name`; - do kubectl logs $i --namespace kube-system kubedns > kubedns.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=kubedns -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system kubedns; done" - name: apiserver_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-apiserver -o name`; - do kubectl logs $i --namespace kube-system > kube-apiserver.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-apiserver -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system; done" - name: controller_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-controller -o name`; - do kubectl logs $i --namespace kube-system > kube-controller.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-controller -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system; done" - name: scheduler_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-scheduler -o name`; - do kubectl logs $i --namespace kube-system > kube-scheduler.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-scheduler -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system; done" - name: proxy_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-proxy -o name`; - do kubectl logs $i --namespace kube-system > kube-proxy.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-proxy -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system; done" - name: nginx_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-nginx -o name`; - do kubectl logs $i --namespace kube-system > kube-nginx.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-nginx -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system; done" - name: flannel_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l app=flannel -o name`; - do kubectl logs $i --namespace kube-system flannel-container > flannel.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l app=flannel -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system flannel-container; done" - name: canal_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=canal-node -o name`; - do kubectl logs $i --namespace kube-system flannel > flannel.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=canal-node -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system flannel; done" - name: calico_policy_logs - cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=calico-policy -o name`; - do kubectl logs $i --namespace kube-system calico-policy-controller > calico-policy-controller.log; done" + cmd: "for i in `kubectl get pods --all-namespaces -l k8s-app=calico-policy -o jsonpath={.items..metadata.name}`; + do kubectl logs ${i} --namespace kube-system calico-policy-controller; done" logs: - /var/log/syslog @@ -68,15 +68,6 @@ - /var/log/calico/bird6/current - /var/log/calico/felix/current - /var/log/calico/confd/current - - weave.log - - kubedns.log - - kube-apiserver.log - - kube-controller.log - - kube-scheduler.log - - kube-proxy.log - - kube-nginx.log - - flannel.log - - calico-policy-controller.log tasks: - name: Storing commands output