Puppet Class: profile::toolforge::prometheus

Defined in:
modules/profile/manifests/toolforge/prometheus.pp

Overview

Parameters:

  • new_k8s_apiserver_fqdn (Stdlib::Fqdn) (defaults to: lookup('profile::toolforge::k8s::apiserver_fqdn', {default_value => 'k8s.tools.eqiad1.wikimedia.cloud'}))
  • paws_apiserver_fqdn (Stdlib::Fqdn) (defaults to: lookup('profile::wmcs::paws::k8s::apiserver_fqdn', {default_value => 'k8s.svc.paws.eqiad1.wikimedia.cloud'}))
  • new_k8s_apiserver_port (Stdlib::Port) (defaults to: lookup('profile::toolforge::k8s::apiserver_port', {default_value => 6443}))
  • paws_apiserver_port (Stdlib::Port) (defaults to: lookup('profile::wmcs::paws::apiserver_port', {default_value => 6443}))
  • proxies (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::toolforge::proxies', {default_value => ['tools-proxy-05.tools.eqiad.wmflabs']}))
  • email_server (Stdlib::Fqdn) (defaults to: lookup('profile::toolforge::active_mail_relay', {default_value => 'tools-mail-02.tools.eqiad1.wikimedia.cloud'}))


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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'modules/profile/manifests/toolforge/prometheus.pp', line 5

class profile::toolforge::prometheus (
    Stdlib::Fqdn  $new_k8s_apiserver_fqdn = lookup('profile::toolforge::k8s::apiserver_fqdn', {default_value => 'k8s.tools.eqiad1.wikimedia.cloud'}),
    Stdlib::Fqdn  $paws_apiserver_fqdn    = lookup('profile::wmcs::paws::k8s::apiserver_fqdn', {default_value => 'k8s.svc.paws.eqiad1.wikimedia.cloud'}),
    Stdlib::Port  $new_k8s_apiserver_port = lookup('profile::toolforge::k8s::apiserver_port', {default_value => 6443}),
    Stdlib::Port  $paws_apiserver_port    = lookup('profile::wmcs::paws::apiserver_port',     {default_value => 6443}),
    Array[Stdlib::Fqdn] $proxies          = lookup('profile::toolforge::proxies',             {default_value => ['tools-proxy-05.tools.eqiad.wmflabs']}),
    Stdlib::Fqdn  $email_server           = lookup('profile::toolforge::active_mail_relay',   {default_value => 'tools-mail-02.tools.eqiad1.wikimedia.cloud'}),
) {
    require ::profile::labs::lvm::srv
    include ::profile::prometheus::blackbox_exporter

    class { '::prometheus::wmcs_scripts': }

    $targets_path = '/srv/prometheus/tools/targets'

    class { '::httpd':
        modules => ['proxy', 'proxy_http'],
    }

    # the certs are used by prometheus to auth to the k8s API and are
    # generated in the k8s control nodes using the wmcs-k8s-get-cert script
    $toolforge_certname  = 'toolforge-k8s-prometheus'
    $cert_pub  = "/etc/ssl/localcerts/${toolforge_certname}.crt"
    $cert_priv = "/etc/ssl/private/${toolforge_certname}.key"
    sslcert::certificate { $toolforge_certname:
        ensure  => present,
        chain   => false,
        group   => 'prometheus',
        require => Package['prometheus'], # group is defined by the package?
        notify  => Service['prometheus@tools'],
    }
    $paws_certname  = 'paws-k8s-prometheus'
    $paws_cert_pub  = "/etc/ssl/localcerts/${paws_certname}.crt"
    $paws_cert_priv = "/etc/ssl/private/${paws_certname}.key"
    sslcert::certificate { $paws_certname:
        ensure  => present,
        chain   => false,
        group   => 'prometheus',
        require => Package['prometheus'], # group is defined by the package?
        notify  => Service['prometheus@tools'],
    }

    prometheus::server { 'tools':
        listen_address       => '127.0.0.1:9902',
        external_url         => 'https://tools-prometheus.wmflabs.org/tools',
        scrape_configs_extra => [
            {
                'job_name'        => 'ssh_banner',
                'metrics_path'    => '/probe',
                'params'          => {
                    'module' => ['ssh_banner'],
                },
                'file_sd_configs' => [
                    {
                        'files' => ["${targets_path}/ssh_banner.yml"]
                    }
                ],
                'relabel_configs' => [
                    # The replacement syntax is for prometheus to consume
                    # lint:ignore:single_quote_string_with_variables
                    {
                        'source_labels' => ['__address__'],
                        'regex'         => '(.*)',
                        'target_label'  => '__param_target',
                        'replacement'   => '${1}',
                    },
                    {
                        'source_labels' => ['__param_target'],
                        'regex'         => '(.*)',
                        'target_label'  => 'instance',
                        'replacement'   => '${1}',
                    },
                    {
                        'source_labels' => [],
                        'regex'         => '.*',
                        'target_label'  => '__address__',
                        'replacement'   => '127.0.0.1:9115',
                    }
                    # lint:endignore
                ]
            },
            {
            'job_name'        => 'etcd',
            'file_sd_configs' => [
                {
                    'files' => [ "${targets_path}/etcd_*.yml" ]
                }
            ]
            },
            {
            'job_name'        => 'toolsdb-mariadb',
            'file_sd_configs' => [
                {
                    'files' => [ "${targets_path}/toolsdb-mariadb.yml" ]
                }
            ]
            },
            {
            'job_name'        => 'toolsdb-node',
            'file_sd_configs' => [
                {
                    'files' => [ "${targets_path}/toolsdb-node.yml" ]
                }
            ]
            },
            {
                'job_name'              => 'new-k8s-nodes',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $cert_pub,
                    'key_file'             => $cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                        'role'       => 'node',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $cert_pub,
                            'key_file'             => $cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_node_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_node_name'],
                        'regex'         => '(.+)',
                        'target_label'  => '__metrics_path__',
                        # lint:ignore:single_quote_string_with_variables
                        'replacement'   => '/api/v1/nodes/${1}/proxy/metrics',
                        # lint:endignore
                    },
                ]
            },
            {
                'job_name'              => 'new-k8s-ingress-nginx',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $cert_pub,
                    'key_file'             => $cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                        'role'       => 'pod',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $cert_pub,
                            'key_file'             => $cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action'        => 'keep',
                        'regex'         => 'ingress-nginx',
                        'source_labels' => ['__meta_kubernetes_pod_label_app_kubernetes_io_name'],
                    },
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_pod_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_pod_name'],
                        'regex'         => '(nginx-ingress-[a-zA-Z0-9]+-[a-zA-Z0-9]+)',
                        'target_label'  => '__metrics_path__',
                        # lint:ignore:single_quote_string_with_variables
                        # PORT is not arbitrary! the pod is listening on that one
                        'replacement'   => '/api/v1/namespaces/ingress-nginx/pods/${1}:10254/proxy/metrics',
                        # lint:endignore
                    },
                ]
            },
            {
                'job_name'              => 'new-k8s-api',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $cert_pub,
                    'key_file'             => $cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                        'role'       => 'endpoints',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $cert_pub,
                            'key_file'             => $cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_node_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_namespace',
                                            '__meta_kubernetes_service_name',
                                            '__meta_kubernetes_endpoint_port_name'],
                        'regex'         => 'default;kubernetes;https',
                        'action'        => 'keep',
                    },
                ]
            },
            {
                'job_name'       => 'new-k8s-haproxy',
                'scheme'         => 'http',
                'static_configs' => [
                    {
                        'targets' => ["${new_k8s_apiserver_fqdn}:9901"],
                    },
                ],
            },
            {
                'job_name'       => 'frontproxy-nginx',
                'scheme'         => 'http',
                'static_configs' => [
                    {
                        'targets' => map($proxies) |$element| { $value = "${element}:9113" },
                    },
                ],
            },
            {
                'job_name'              => 'new-k8s-kube-state-metrics',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $cert_pub,
                    'key_file'             => $cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                        'role'       => 'pod',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $cert_pub,
                            'key_file'             => $cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_node_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                    },
                    {
                        'target_label' => '__metrics_path__',
                        # this service is not an arbitrary name; it was created
                        # inside the k8s cluster with that specific name
                        'replacement'  => '/api/v1/namespaces/metrics/services/kube-state-metrics/proxy/metrics',
                    },
                ]
            },
            {
                'job_name'              => 'new-k8s-cadvisor',
                'scheme'                => 'https',
                'scrape_interval'       => '4m',
                'scrape_timeout'        => '60s',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $cert_pub,
                    'key_file'             => $cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                        'role'       => 'pod',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $cert_pub,
                            'key_file'             => $cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action'        => 'keep',
                        'regex'         => 'cadvisor',
                        'source_labels' => ['__meta_kubernetes_pod_label_app'],
                    },
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_pod_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${new_k8s_apiserver_fqdn}:${new_k8s_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_pod_name'],
                        'regex'         => '(cadvisor-[a-zA-Z0-9]+)',
                        'target_label'  => '__metrics_path__',
                        # lint:ignore:single_quote_string_with_variables
                        'replacement'   => '/api/v1/namespaces/metrics/pods/${1}/proxy/metrics',
                        # lint:endignore
                    },
                ]
            },
            {
                'job_name'              => 'paws-nodes',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $paws_cert_pub,
                    'key_file'             => $paws_cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${paws_apiserver_fqdn}:${paws_apiserver_port}",
                        'role'       => 'node',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $paws_cert_pub,
                            'key_file'             => $paws_cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_node_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${paws_apiserver_fqdn}:${paws_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_node_name'],
                        'regex'         => '(.+)',
                        'target_label'  => '__metrics_path__',
                        # lint:ignore:single_quote_string_with_variables
                        'replacement'   => '/api/v1/nodes/${1}/proxy/metrics',
                        # lint:endignore
                    },
                ]
            },
            {
                'job_name'              => 'paws-ingress-nginx',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $paws_cert_pub,
                    'key_file'             => $paws_cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${paws_apiserver_fqdn}:${paws_apiserver_port}",
                        'role'       => 'pod',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $paws_cert_pub,
                            'key_file'             => $paws_cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action'        => 'keep',
                        'regex'         => 'ingress-nginx',
                        'source_labels' => ['__meta_kubernetes_pod_label_app_kubernetes_io_name'],
                    },
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_pod_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${paws_apiserver_fqdn}:${paws_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_pod_name'],
                        'regex'         => '(nginx-ingress-[a-zA-Z0-9]+-[a-zA-Z0-9]+)',
                        'target_label'  => '__metrics_path__',
                        # lint:ignore:single_quote_string_with_variables
                        # PORT is not arbitrary! the pod is listening on that one
                        'replacement'   => '/api/v1/namespaces/ingress-nginx/pods/${1}:10254/proxy/metrics',
                        # lint:endignore
                    },
                ]
            },
            {
                'job_name'              => 'paws-api',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $paws_cert_pub,
                    'key_file'             => $paws_cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${paws_apiserver_fqdn}:${paws_apiserver_port}",
                        'role'       => 'endpoints',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $paws_cert_pub,
                            'key_file'             => $paws_cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_node_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${paws_apiserver_fqdn}:${paws_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_namespace',
                                            '__meta_kubernetes_service_name',
                                            '__meta_kubernetes_endpoint_port_name'],
                        'regex'         => 'default;kubernetes;https',
                        'action'        => 'keep',
                    },
                ]
            },
            {
                'job_name'       => 'paws-haproxy',
                'scheme'         => 'http',
                'static_configs' => [
                    {
                        'targets' => ["${paws_apiserver_fqdn}:9901"],
                    },
                ],
            },
            {
                'job_name'              => 'paws-kube-state-metrics',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $paws_cert_pub,
                    'key_file'             => $paws_cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${paws_apiserver_fqdn}:${paws_apiserver_port}",
                        'role'       => 'pod',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $paws_cert_pub,
                            'key_file'             => $paws_cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_node_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${paws_apiserver_fqdn}:${paws_apiserver_port}",
                    },
                    {
                        'target_label' => '__metrics_path__',
                        # this service is not an arbitrary name; it was created
                        # inside the k8s cluster with that specific name
                        'replacement'  => '/api/v1/namespaces/metrics/services/kube-state-metrics/proxy/metrics',
                    },
                ]
            },
            {
                'job_name'              => 'paws-cadvisor',
                'scheme'                => 'https',
                'tls_config'            => {
                    'insecure_skip_verify' => true,
                    'cert_file'            => $paws_cert_pub,
                    'key_file'             => $paws_cert_priv,
                },
                'kubernetes_sd_configs' => [
                    {
                        'api_server' => "https://${paws_apiserver_fqdn}:${paws_apiserver_port}",
                        'role'       => 'pod',
                        'tls_config' => {
                            'insecure_skip_verify' => true,
                            'cert_file'            => $paws_cert_pub,
                            'key_file'             => $paws_cert_priv,
                        },
                    },
                ],
                'relabel_configs'       => [
                    {
                        'action'        => 'keep',
                        'regex'         => 'cadvisor',
                        'source_labels' => ['__meta_kubernetes_pod_label_app'],
                    },
                    {
                        'action' => 'labelmap',
                        'regex'  => '__meta_kubernetes_pod_label_(.+)',
                    },
                    {
                        'target_label' => '__address__',
                        'replacement'  => "${paws_apiserver_fqdn}:${paws_apiserver_port}",
                    },
                    {
                        'source_labels' => ['__meta_kubernetes_pod_name'],
                        'regex'         => '(cadvisor-[a-zA-Z0-9]+)',
                        'target_label'  => '__metrics_path__',
                        # lint:ignore:single_quote_string_with_variables
                        'replacement'   => '/api/v1/namespaces/metrics/pods/${1}/proxy/metrics',
                        # lint:endignore
                    },
                ]
            },
            {
                'job_name'       => 'paws-jupyterhub',
                'scheme'         => 'https',
                'metrics_path'   => '/hub/metrics',
                'static_configs' => [
                    {
                        'targets' => ['hub.paws.wmcloud.org'],
                    },
                ],
            },
            {
                'job_name'       => 'tools-email',
                'scheme'         => 'http',
                'static_configs' => [
                    {
                        # this is using mtail exim which listens on 3903 by default
                        'targets' => ["${email_server}:3903"],
                    },
                ],
            },
        ]
    }

    prometheus::web { 'tools':
        proxy_pass => 'http://localhost:9902/tools',
    }

    file { "${targets_path}/toolsdb-mariadb.yml":
      content => ordered_yaml([{
        'targets' => ['clouddb1001.clouddb-services.eqiad.wmflabs:9104',
                      'clouddb1002.clouddb-services.eqiad.wmflabs:9104',
            ]
        }]),
    }

    file { "${targets_path}/toolsdb-node.yml":
      content => ordered_yaml([{
        'targets' => ['clouddb1001.clouddb-services.eqiad.wmflabs:9100',
                      'clouddb1002.clouddb-services.eqiad.wmflabs:9100',
            ]
        }]),
    }

    cron { 'prometheus_tools_project_targets':
        ensure  => present,
        command => "/usr/local/bin/prometheus-labs-targets > ${targets_path}/node_project.$$ && mv ${targets_path}/node_project.$$ ${targets_path}/node_project.yml",
        minute  => '*/10',
        hour    => '*',
        user    => 'prometheus',
    }

    cron { 'prometheus_paws_project_targets':
        ensure  => present,
        command => "/usr/local/bin/prometheus-labs-targets --project paws > ${targets_path}/node_paws.$$ && mv ${targets_path}/node_paws.$$ ${targets_path}/node_paws.yml",
        minute  => '*/10',
        hour    => '*',
        user    => 'prometheus',
    }

    cron { 'prometheus_paws_k8s_etcd_targets':
        ensure  => present,
        command => "/usr/local/bin/prometheus-labs-targets --project paws --port 2381 --prefix paws-k8s-control- > ${targets_path}/etcd_paws.$$ && mv ${targets_path}/etcd_paws.$$ ${targets_path}/etcd_paws.yml",
        minute  => '*/10',
        hour    => '*',
        user    => 'prometheus',
    }

    cron { 'prometheus_tools_project_ssh_targets':
        ensure  => present,
        command => "/usr/local/bin/prometheus-labs-targets --port 22 > ${targets_path}/ssh_banner.$$ && mv ${targets_path}/ssh_banner.$$ ${targets_path}/ssh_banner.yml",
        minute  => '*/10',
        hour    => '*',
        user    => 'prometheus',
    }

    cron { 'prometheus_tools_k8s_etcd_targets':
        ensure  => present,
        command => "/usr/local/bin/prometheus-labs-targets --port 9051 --prefix tools-k8s-etcd- > ${targets_path}/etcd_k8s.$$ && mv ${targets_path}/etcd_k8s.$$ ${targets_path}/etcd_k8s.yml",
        minute  => '*/10',
        hour    => '*',
        user    => 'prometheus',
    }
}