Pārlūkot izejas kodu

Collect a list of containers on bootstrap node and show their logs

Vadim Rutkovsky 6 gadi atpakaļ
vecāks
revīzija
239f75d14f
1 mainītis faili ar 10 papildinājumiem un 0 dzēšanām
  1. 10 0
      playbooks/deploy_cluster_40.yml

+ 10 - 0
playbooks/deploy_cluster_40.yml

@@ -55,6 +55,16 @@
       command: journalctl --no-pager -u bootkube
       register: bootkube_logs
       ignore_errors: true
+    - name: Collect a list of containers
+      command: crictl ps -a -q
+      register: crictl_ps_output
+    - name: Collect container logs
+      command: "crictl logs {{ item }}"
+      register: crictl_logs_output
+      with_items: "{{ crictl_ps_output.stdout_lines }}"
+      ignore_errors: true
+    - debug:
+        var: crictl_logs_output
     - debug:
         msg: "{{ bootkube_logs.stdout_lines }}"
     - fail: