-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreate-monitoring-targets.yaml
117 lines (102 loc) · 4.13 KB
/
create-monitoring-targets.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
- name: Configure blackbox-exporter jobs
hosts: localhost
gather_facts: no
tasks:
- name: Creating the ping-v4 ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/ping-v4-job.yaml') | from_yaml }}"
apply: no
- name: Creating the ssh-banner ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/ssh-service-job.yaml') | from_yaml }}"
apply: no
- name: Creating the web-service ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/web-service-job.yaml') | from_yaml }}"
apply: no
- name: Configuring snmp-exporter jobs
hosts: localhost
gather_facts: no
tasks:
- name: Creating the network-devices ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/network-devices-job.yaml') | from_yaml }}"
apply: no
- name: Creating the power-devices ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/power-devices-job.yaml') | from_yaml }}"
apply: no
- name: Configuring host jobs
hosts: localhost
gather_facts: no
tasks:
- name: Searching for the node-exporter auth secret
kubernetes.core.k8s_info:
api_version: v1
kind: Secret
namespace: internal-monitoring
name: "{{ node_exporter_secret_name }}"
register: node_exporter_secret_result
- name: Checking if the node-exporter auth secret exists
ansible.builtin.assert:
that: node_exporter_secret_result.resources | length == 1
fail_msg: Please define a secret for Prometheus to use to authenticate against node-exporter instances
- name: Creating the host-metrics ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/host-metrics-job.yaml') | from_yaml }}"
apply: no
- name: Creating the bmc-metrics ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/bmc-metrics-job.yaml') | from_yaml }}"
apply: no
- name: Creating the pmc-metrics ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/pmc-metrics-job.yaml') | from_yaml }}"
apply: no
- name: Configuring InfluxDB job
hosts: localhost
gather_facts: no
tasks:
- name: Dumping InfluxDB static config
ansible.builtin.debug:
msg: "{{ lookup('template', 'manifests/monitoring/targets/influxdb_service.yaml.j2') }}"
verbosity: 3
- name: Dumping InfluxDB ScrapeConfig
ansible.builtin.debug:
msg: "{{ lookup('template', 'manifests/monitoring/influxdb-service-job.yaml') }}"
verbosity: 3
- name: Creating the InfluxDB ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/influxdb-service-job.yaml') | from_yaml }}"
apply: no
- name: Configuring BIRD job
hosts: localhost
gather_facts: no
tasks:
- name: Creating the BIRD ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/bird-service-job.yaml') | from_yaml }}"
apply: no
- name: Configuring MySQL job
hosts: localhost
gather_facts: no
tasks:
- name: Creating the MySQL ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/mysql-service-job.yaml') | from_yaml }}"
apply: no
- name: Configuring PostgreSQL job
hosts: localhost
tasks:
- name: Creating the PostgreSQL ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('template', 'manifests/monitoring/postgresql-service-job.yaml') | from_yaml }}"
apply: no
- name: Configuring Jenkins job
hosts: localhost
gather_facts: no
tasks:
- name: Creating the Jenkins ScrapeConfig
kubernetes.core.k8s:
resource_definition: "{{ lookup('file', 'monitoring/jenkins-job.yaml') | from_yaml }}"
apply: no