Skip to content

Commit

Permalink
add option to enable prometheus with real certs
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Nov 19, 2024
1 parent 325c0ba commit 7e22db8
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 7e22db8

Please sign in to comment.