Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ljuaneda opened this issue Jun 14, 2022 · 2 comments
Open

Comments

@ljuaneda
Copy link

ljuaneda commented Jun 14, 2022

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

@aaronchar
Copy link

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

@KhizerJaan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants