Fix collect_info script

Fix missing journal ctl utc key.
Rework kube* logs collection.

Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2016-11-14 17:09:52 +01:00
parent 70f8780e38
commit cc1d26f939

View file

@ -22,40 +22,40 @@
- name: k8s_info - name: k8s_info
cmd: kubectl get all --all-namespaces -o wide cmd: kubectl get all --all-namespaces -o wide
- name: errors_info - name: errors_info
cmd: journalctl -p err --utc --no-pager cmd: journalctl -p err --no-pager
- name: etcd_info - name: etcd_info
cmd: etcdctl --debug cluster-health cmd: etcdctl --debug cluster-health
- name: weave_info - name: weave_info
cmd: weave report | jq "." cmd: weave report | jq "."
- name: weave_logs - name: weave_logs
cmd: docker logs weave > weave.log cmd: docker logs weave
- name: kubedns_logs - name: kubedns_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kubedns -o name`; 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 > kubedns.log; done" do kubectl logs ${i} --namespace kube-system kubedns; done"
- name: apiserver_logs - name: apiserver_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-apiserver -o name`; 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 > kube-apiserver.log; done" do kubectl logs ${i} --namespace kube-system; done"
- name: controller_logs - name: controller_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-controller -o name`; 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 > kube-controller.log; done" do kubectl logs ${i} --namespace kube-system; done"
- name: scheduler_logs - name: scheduler_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-scheduler -o name`; 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 > kube-scheduler.log; done" do kubectl logs ${i} --namespace kube-system; done"
- name: proxy_logs - name: proxy_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-proxy -o name`; 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 > kube-proxy.log; done" do kubectl logs ${i} --namespace kube-system; done"
- name: nginx_logs - name: nginx_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=kube-nginx -o name`; 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 > kube-nginx.log; done" do kubectl logs ${i} --namespace kube-system; done"
- name: flannel_logs - name: flannel_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l app=flannel -o name`; 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 > flannel.log; done" do kubectl logs ${i} --namespace kube-system flannel-container; done"
- name: canal_logs - name: canal_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=canal-node -o name`; 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 > flannel.log; done" do kubectl logs ${i} --namespace kube-system flannel; done"
- name: calico_policy_logs - name: calico_policy_logs
cmd: sh -c "for i in `kubectl get pods --all-namespaces -l k8s-app=calico-policy -o name`; 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 > calico-policy-controller.log; done" do kubectl logs ${i} --namespace kube-system calico-policy-controller; done"
logs: logs:
- /var/log/syslog - /var/log/syslog
@ -68,15 +68,6 @@
- /var/log/calico/bird6/current - /var/log/calico/bird6/current
- /var/log/calico/felix/current - /var/log/calico/felix/current
- /var/log/calico/confd/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: tasks:
- name: Storing commands output - name: Storing commands output