@@ -1145,6 +1145,8 @@ def test_node_exporter_config_with_mgmt_gw(
11451145 @patch ("cephadm.module.CephadmOrchestrator._get_mgr_ips" , lambda _ : ['192.168.100.100' , '::1' ])
11461146 def test_prometheus_config_security_disabled (self , _run_cephadm , cephadm_module : CephadmOrchestrator ):
11471147 _run_cephadm .side_effect = async_side_effect (('{}' , '' , 0 ))
1148+ pool = 'testpool'
1149+ group = 'mygroup'
11481150 s = RGWSpec (service_id = "foo" , placement = PlacementSpec (count = 1 ), rgw_frontend_type = 'beast' )
11491151 with with_host (cephadm_module , 'test' ):
11501152 # host "test" needs to have networks for keepalive to be placed
@@ -1165,6 +1167,9 @@ def test_prometheus_config_security_disabled(self, _run_cephadm, cephadm_module:
11651167 keepalived_password = '12345' ,
11661168 virtual_ip = "1.2.3.4/32" ,
11671169 backend_service = 'rgw.foo' )) as _ , \
1170+ with_service (cephadm_module , NvmeofServiceSpec (service_id = f'{ pool } .{ group } ' ,
1171+ group = group ,
1172+ pool = pool )) as _ , \
11681173 with_service (cephadm_module , PrometheusSpec ('prometheus' ,
11691174 networks = ['1.2.3.0/24' ],
11701175 only_bind_port_on_networks = True )) as _ :
@@ -1231,6 +1236,16 @@ def test_prometheus_config_security_disabled(self, _run_cephadm, cephadm_module:
12311236 - url: http://192.168.100.100:8765/sd/prometheus/sd-config?service=node-exporter
12321237 - url: http://[::1]:8765/sd/prometheus/sd-config?service=node-exporter
12331238
1239+ - job_name: 'nvmeof'
1240+ relabel_configs:
1241+ - source_labels: [__address__]
1242+ target_label: cluster
1243+ replacement: fsid
1244+ honor_labels: true
1245+ http_sd_configs:
1246+ - url: http://192.168.100.100:8765/sd/prometheus/sd-config?service=nvmeof
1247+ - url: http://[::1]:8765/sd/prometheus/sd-config?service=nvmeof
1248+
12341249
12351250 """ ).lstrip ()
12361251
@@ -1282,6 +1297,8 @@ def test_prometheus_config_security_disabled(self, _run_cephadm, cephadm_module:
12821297 def test_prometheus_config_security_enabled (self , _run_cephadm , _get_uname , cephadm_module : CephadmOrchestrator ):
12831298 _run_cephadm .side_effect = async_side_effect (('{}' , '' , 0 ))
12841299 _get_uname .return_value = 'test'
1300+ pool = 'testpool'
1301+ group = 'mygroup'
12851302 s = RGWSpec (service_id = "foo" , placement = PlacementSpec (count = 1 ), rgw_frontend_type = 'beast' )
12861303 smb_spec = SMBSpec (cluster_id = 'foxtrot' , config_uri = 'rados://.smb/foxtrot/config.json' ,)
12871304
@@ -1312,6 +1329,9 @@ def test_prometheus_config_security_enabled(self, _run_cephadm, _get_uname, ceph
13121329 keepalived_password = '12345' ,
13131330 virtual_ip = "1.2.3.4/32" ,
13141331 backend_service = 'rgw.foo' )) as _ , \
1332+ with_service (cephadm_module , NvmeofServiceSpec (service_id = f'{ pool } .{ group } ' ,
1333+ group = group ,
1334+ pool = pool )) as _ , \
13151335 with_service (cephadm_module , PrometheusSpec ('prometheus' )) as _ :
13161336
13171337 web_config = dedent ("""
@@ -1442,6 +1462,27 @@ def test_prometheus_config_security_enabled(self, _run_cephadm, _get_uname, ceph
14421462 cert_file: prometheus.crt
14431463 key_file: prometheus.key
14441464
1465+ - job_name: 'nvmeof'
1466+ relabel_configs:
1467+ - source_labels: [__address__]
1468+ target_label: cluster
1469+ replacement: fsid
1470+ scheme: https
1471+ tls_config:
1472+ ca_file: root_cert.pem
1473+ cert_file: prometheus.crt
1474+ key_file: prometheus.key
1475+ honor_labels: true
1476+ http_sd_configs:
1477+ - url: https://[::1]:8765/sd/prometheus/sd-config?service=nvmeof
1478+ basic_auth:
1479+ username: sd_user
1480+ password: sd_password
1481+ tls_config:
1482+ ca_file: root_cert.pem
1483+ cert_file: prometheus.crt
1484+ key_file: prometheus.key
1485+
14451486 - job_name: 'smb'
14461487 relabel_configs:
14471488 - source_labels: [__address__]
0 commit comments