Browse Source

Add kubelet and cri-o logs in the output

Vadim Rutkovsky 6 years ago
parent
commit
8c469f9131
2 changed files with 23 additions and 1 deletions
  1. 12 0
      roles/container_runtime/tasks/package_crio.yml
  2. 11 1
      test/aws/scaleup.yml

+ 12 - 0
roles/container_runtime/tasks/package_crio.yml

@@ -97,6 +97,18 @@
     state: restarted
     daemon_reload: yes
   register: start_result
+  ignore_errors: true
+
+- when: start_result is failed
+  block:
+    - name: Get crio logs
+      command: journalctl --no-pager -u crio
+      register: crio_logs
+      ignore_errors: true
+    - debug:
+        msg: "{{ crio_logs.stdout_lines }}"
+    - fail:
+        msg: crio start failed.
 
 # If we are using crio only, docker.service might not be available for
 # 'docker login'

+ 11 - 1
test/aws/scaleup.yml

@@ -100,10 +100,20 @@
       register: crictl_logs_output
       with_items: "{{ crictl_ps_output.stdout_lines }}"
       ignore_errors: true
+    - name: Get crio logs
+      command: journalctl --no-pager -u cri-o
+      register: crio_logs
+      ignore_errors: true
+    - name: Get kubelet logs
+      command: journalctl --no-pager -u kubelet
+      register: kubelet_logs
+      ignore_errors: tru
     - debug:
         var: crictl_logs_output
     - debug:
-        msg: "{{ bootkube_logs.stdout_lines }}"
+        msg: "{{ kubelet_logs.stdout_lines }}"
+    - debug:
+        msg: "{{ crio_logs.stdout_lines }}"
     - fail:
         msg: Node failed to become Ready