-
Notifications
You must be signed in to change notification settings - Fork 130
/
Copy pathmain.yml
56 lines (48 loc) · 1.69 KB
/
main.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
- block:
- name: Create kube-burner configmap
k8s:
definition:
apiVersion: v1
kind: ConfigMap
metadata:
name: system-metrics-collector-{{ trunc_uuid }}
namespace: "{{ operator_namespace }}"
data:
index.yml: "{{ lookup('template', 'index.yml')}}"
node-metrics.yml: "{{ lookup('template', 'node-metrics.yml')}}"
- name: Launching kube-burner job to index system-metrics
k8s:
definition: "{{ lookup('template', 'kube-burner.yml.j2') | from_yaml }}"
- name: Get job status
k8s_info:
kind: Job
api_version: v1
namespace: '{{ operator_namespace }}'
name: system-metrics-collector-{{ trunc_uuid }}
register: job_state
- name: Set collecting state to system-metrics benchmark
operator_sdk.util.k8s_status:
api_version: ripsaw.cloudbulldozer.io/v1alpha1
kind: Benchmark
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ operator_namespace }}"
status:
system_metrics: Collecting
when: benchmark_state.resources[0].status.system_metrics == "Not collected"
- name: Get job status
k8s_info:
kind: Job
api_version: v1
namespace: '{{ operator_namespace }}'
name: system-metrics-collector-{{ trunc_uuid }}
register: job_state
- name: Set collected state to system-metrics benchmark
operator_sdk.util.k8s_status:
api_version: ripsaw.cloudbulldozer.io/v1alpha1
kind: Benchmark
name: "{{ ansible_operator_meta.name }}"
namespace: "{{ operator_namespace }}"
status:
system_metrics: Collected
when: job_state.resources[0].status.succeeded is defined and (job_state.resources[0].status.succeeded | int) > 0