cockroachdb / helm-charts

Helm charts for cockroachdb
Apache License 2.0
83 stars 150 forks source link

Bug: ServiceMonitor should use https instead of http #386

Open incubator4 opened 5 months ago

incubator4 commented 5 months ago

current servicemonitor resources without option scheme, it can only be used for insecure clusters, example like this.

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: cockroachdb
spec:
  endpoints:
    - interval: 10s
      path: /_status/vars
      port: http
      # without scheme: https
      tlsConfig:
        ca:
          secret:
            key: ca.crt
            name: cockroachdb-node
        cert:
          secret:
            key: tls.crt
            name: cockroachdb-node
        insecureSkipVerify: true
        keySecret:
          key: tls.key
          name: cockroachdb-node
  namespaceSelector:
    any: true
  selector:
    matchLabels:
      app.kubernetes.io/component: cockroachdb
      app.kubernetes.io/instance: cockroachdb
      app.kubernetes.io/name: cockroachdb
incubator4 commented 5 months ago

And relabelings config is missing, a better suggestion is that, use cluster-name on relabelings to add additional labels for cluster, it makes better to run multiple helm releases in a cluster for monitor

incubator4 commented 5 months ago

Added: due to service cockroachdb-public(ClusterIP) and cockroachdb(headless) have some labels, it might create duplicate target on prometheus targets(or any other prometheus-like system)