Skip to content

Commit 2c8edd2

Browse files
authored
Merge pull request #307 from lsst-it/IT-5219/puppetdb-auth
(ayekan) enable puppetdb http basic auth + use enc data as labels
2 parents 0b40fed + 5ffc642 commit 2c8edd2

File tree

1 file changed

+38
-6
lines changed
  • fleet/lib/kube-prometheus-stack/overlays/ayekan

1 file changed

+38
-6
lines changed

fleet/lib/kube-prometheus-stack/overlays/ayekan/values.yaml

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@ prometheus:
44
configMaps:
55
- prometheus-snmp-csv-network
66
- pdu-targets
7+
secrets:
8+
- puppetdb
79
additionalScrapeConfigs:
810
- job_name: node-exporter-dev
911
puppetdb_sd_configs:
10-
- url: "http://puppetdb.dev.lsst.org:8080"
11-
query: "resources { type = \"Class\" and title = \"Prometheus::Node_exporter\" }"
12+
- url: https://puppetdb.dev.lsst.org:8443
13+
basic_auth:
14+
username: svc_prometheus
15+
password_file: /etc/prometheus/secrets/puppetdb/password
16+
query: |
17+
resources {
18+
type = "Class" and title = "Profile::Core::Node_info" and
19+
certname in resources[certname] {
20+
type = "Class" and title = "Prometheus::Node_exporter"
21+
}
22+
}
1223
refresh_interval: "30s"
1324
follow_redirects: true
1425
include_parameters: true
@@ -19,10 +30,25 @@ prometheus:
1930
target_label: instance
2031
- source_labels: [__meta_puppetdb_environment]
2132
target_label: environment
33+
- source_labels: [__meta_puppetdb_parameter_site]
34+
target_label: site
35+
- source_labels: [__meta_puppetdb_parameter_role]
36+
target_label: role
37+
- source_labels: [__meta_puppetdb_parameter_cluster]
38+
target_label: cluster
2239
- job_name: node-exporter-ls
2340
puppetdb_sd_configs:
24-
- url: "http://puppetdb.ls.lsst.org:8080"
25-
query: "resources { type = \"Class\" and title = \"Prometheus::Node_exporter\" }"
41+
- url: https://puppetdb.ls.lsst.org:8443
42+
basic_auth:
43+
username: svc_prometheus
44+
password_file: /etc/prometheus/secrets/puppetdb/password
45+
query: |
46+
resources {
47+
type = "Class" and title = "Profile::Core::Node_info" and
48+
certname in resources[certname] {
49+
type = "Class" and title = "Prometheus::Node_exporter"
50+
}
51+
}
2652
refresh_interval: "30s"
2753
follow_redirects: true
2854
include_parameters: true
@@ -34,7 +60,10 @@ prometheus:
3460
params:
3561
module: [icmp]
3662
puppetdb_sd_configs:
37-
- url: "http://puppetdb.dev.lsst.org:8080"
63+
- url: https://puppetdb.dev.lsst.org:8443
64+
basic_auth:
65+
username: svc_prometheus
66+
password_file: /etc/prometheus/secrets/puppetdb/password
3867
query: "resources { type = \"Class\" and title = \"Prometheus::Node_exporter\" }"
3968
refresh_interval: "30s"
4069
follow_redirects: true
@@ -52,7 +81,10 @@ prometheus:
5281
params:
5382
module: [icmp]
5483
puppetdb_sd_configs:
55-
- url: "http://puppetdb.ls.lsst.org:8080"
84+
- url: https://puppetdb.ls.lsst.org:8443
85+
basic_auth:
86+
username: svc_prometheus
87+
password_file: /etc/prometheus/secrets/puppetdb/password
5688
query: "resources { type = \"Class\" and title = \"Prometheus::Node_exporter\" }"
5789
refresh_interval: "30s"
5890
follow_redirects: true

0 commit comments

Comments
 (0)