Skip to content

Commit 9307060

Browse files
authored
Add TLS certs and keys for cc-worker metrics endpoint (#509)
* Add TLS certs and keys for cc-worker metrics endpoint * Configure prom_scraper to use https for cc-worker metrics
1 parent bc797c2 commit 9307060

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

jobs/cloud_controller_worker/spec

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ templates:
3232
uaa_ca.crt.erb: config/certs/uaa_ca.crt
3333
db_ca.crt.erb: config/certs/db_ca.crt
3434
prom_scraper_config.yml.erb: config/prom_scraper_config.yml
35+
scrape.crt.erb: config/certs/scrape.crt
36+
scrape.key.erb: config/certs/scrape.key
37+
scrape_ca.crt.erb: config/certs/scrape_ca.crt
3538

3639
packages:
3740
- capi_utils
@@ -434,9 +437,16 @@ properties:
434437
cc.prometheus_port:
435438
default: 9394
436439
description: "When 'cc.publish_metrics' is set to true, the webserver, which publishes the metrics, will listen on this port."
440+
437441
cc.prom_scraper.disabled:
438442
default: false
439443
description: "When 'cc.publish_metrics' is enabled, a prom_scraper_config will be automatically generated. If you want to use another component for scraping, you can disable scraping by prom_scraper for cc-worker metrics with this."
444+
cc.prom_scraper_tls.ca_cert:
445+
description: "PEM-encoded CA certificate for secure, mutually authenticated TLS communication with prom_scraper"
446+
cc.prom_scraper_tls.public_cert:
447+
description: "PEM-encoded certificate for secure, mutually authenticated TLS communication with prom_scraper"
448+
cc.prom_scraper_tls.private_key:
449+
description: "PEM-encoded key for secure, mutually authenticated TLS communication with prom_scraper"
440450

441451
cc.directories.tmpdir:
442452
default: "/var/vcap/data/cloud_controller_worker/tmp"

jobs/cloud_controller_worker/templates/prom_scraper_config.yml.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
port: <%= p("cc.prometheus_port") %>
33
source_id: "cloud_controller_worker"
44
instance_id: <%= spec.id || spec.index.to_s %>
5-
scheme: http
5+
scheme: https
6+
server_name: "cc_worker_metrics"
67
path: /metrics
78
<% end -%>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= p('cc.prom_scraper_tls.public_cert', '') %>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= p('cc.prom_scraper_tls.private_key', '') %>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= p('cc.prom_scraper_tls.ca_cert', '') %>

0 commit comments

Comments
 (0)