group-sync-operator
group-sync-operator copied to clipboard
ServiceMonitor's serverName is wrong when not in the default namespace
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
Same issue with 4.9. Just wanted to add that in.
Facing same issue. Is there any work around to use namespace other than group-sync-operator.