-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcapture-envoy-info.yaml
40 lines (40 loc) · 1.39 KB
/
capture-envoy-info.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
- name: Create temporary dir for envoy info
tempfile:
prefix: "envoy-"
state: directory
register: envoy_info_dir
- name: Capture info from gateways
loop: "{{ ['certs', 'clusters', 'config_dump', 'listeners', 'memory', 'runtime', 'server_info', 'stats'] | product(gateway_pods.stdout.split()) | list }}"
shell: "oc exec -n {{ control_plane }} -c istio-proxy {{ item[1] }} -- curl -s localhost:15000/{{ item[0] }} > {{ envoy_info_dir.path }}/{{ item[1] }}_{{ item[0] }}"
async: 3600
poll: 0
register: gateway_pod_info
- name: Wait for the info
loop: "{{ gateway_pod_info.results }}"
async_status:
jid: "{{ item.ansible_job_id }}"
retries: 360
delay: 10
- name: Capture info from sidecars
loop: "{{ ['stats'] | product(workload_pods.stdout.split()) | list }}"
shell: "oc exec -n {{ namespace }} -c istio-proxy {{ item[1] }} -- curl -s localhost:15000/{{ item[0] }} > {{ envoy_info_dir.path }}/{{ item[1] }}_{{ item[0] }}"
async: 3600
poll: 0
register: workload_pod_info
- name: Wait for the info
loop: "{{ workload_pod_info.results }}"
async_status:
jid: "{{ item.ansible_job_id }}"
register: async_poll_results
until: async_poll_results.finished
retries: 360
delay: 10
- name: Zip info
archive:
format: zip
path: "{{ envoy_info_dir.path }}/*"
dest: "{{ dest }}"
- name: Delete temporary dir
file:
path: "{{ envoy_info_dir.path }}"
state: absent