monitor.yaml 1.2 KB

123456789101112131415161718192021222324252627
  1. # Prometheus Monitor Service (Metrics)
  2. apiVersion: monitoring.coreos.com/v1
  3. kind: ServiceMonitor
  4. metadata:
  5. labels:
  6. control-plane: controller-manager
  7. app.kubernetes.io/name: loco-operator
  8. app.kubernetes.io/managed-by: kustomize
  9. name: controller-manager-metrics-monitor
  10. namespace: system
  11. spec:
  12. endpoints:
  13. - path: /metrics
  14. port: https # Ensure this is the name of the port that exposes HTTPS metrics
  15. scheme: https
  16. bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
  17. tlsConfig:
  18. # TODO(user): The option insecureSkipVerify: true is not recommended for production since it disables
  19. # certificate verification, exposing the system to potential man-in-the-middle attacks.
  20. # For production environments, it is recommended to use cert-manager for automatic TLS certificate management.
  21. # To apply this configuration, enable cert-manager and use the patch located at config/prometheus/servicemonitor_tls_patch.yaml,
  22. # which securely references the certificate from the 'metrics-server-cert' secret.
  23. insecureSkipVerify: true
  24. selector:
  25. matchLabels:
  26. control-plane: controller-manager
  27. app.kubernetes.io/name: loco-operator