group-sync-operator icon indicating copy to clipboard operation
group-sync-operator copied to clipboard

ServiceMonitor's serverName is wrong when not in the default namespace

Open ljuaneda opened this issue 3 years ago • 2 comments

Hi,

when you've deployed the operator through the operatorhub on openshift 4.10 in a different namespace than 'group-sync-operator' prometheus gets a tls error when trying to scrape for metrics.

that is because the servicemonitor get the wrong serverName :

❯ oc -n my-namespace get servicemonitor group-sync-operator-controller-manager-metrics-monitor -o yaml | kubectl-neat apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: labels: control-plane: controller-manager name: group-sync-operator-controller-manager-metrics-monitor namespace: my-namespace spec: endpoints:

  • bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token interval: 30s port: https scheme: https tlsConfig: caFile: /etc/prometheus/configmaps/serving-certs-ca-bundle/service-ca.crt serverName: group-sync-operator-controller-manager-metrics-service.group-sync-operator.svc selector: matchLabels: control-plane: controller-manager

seems that the namespace part of the serverName is hardcoded don't you think ?

regards

Ludovic

ljuaneda avatar Jun 14 '22 14:06 ljuaneda

Same issue with 4.9. Just wanted to add that in.

aaronchar avatar Jun 15 '22 19:06 aaronchar

Facing same issue. Is there any work around to use namespace other than group-sync-operator.

KhizerJaan avatar Dec 28 '22 08:12 KhizerJaan