Skip to content

Commit

Permalink
Add an option to enable Prometheus with real certificates
Browse files Browse the repository at this point in the history
While the install scripts do not enable Prometheus integration by default, solutions running upstream may want to use and enable it with Prometheus. This addition offers a way for upstream users to understand how to properly configure Prometheus using real certificates.

At the very least, it serves as documentation and provides an option for those installing from source who want to implement secure Prometheus integration.
  • Loading branch information
camilamacedo86 committed Nov 19, 2024
1 parent b72cd2e commit aaf8ce9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions config/base/prometheus/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
resources:
- monitor.yaml

# [PROMETHEUS WITH CERTMANAGER] The following patch configures the ServiceMonitor in ../prometheus
# to securely reference certificates created and managed by cert-manager.
# Additionally, ensure that you uncomment the [METRICS WITH CERTMANAGER] patch under config/default/kustomization.yaml
# to mount the "metrics-server-cert" secret in the Manager Deployment.
patches:
- path: patches/monitor_tls_patch.yaml
target:
kind: ServiceMonitor
22 changes: 22 additions & 0 deletions config/base/prometheus/paches/monitor_tls_patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patch for Prometheus ServiceMonitor to enable secure TLS configuration
# using certificates managed by cert-manager
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: controller-manager-metrics-monitor
namespace: system
spec:
endpoints:
- tlsConfig:
insecureSkipVerify: false
ca:
secret:
name: olmv1-ca
key: ca.crt
cert:
secret:
name: olmv1-ca
key: olm-ca.crt
keySecret:
name: olmv1-ca
key: ca.crt

0 comments on commit aaf8ce9

Please sign in to comment.