You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Monitoring Endpoint causing HTTPS to be default scheme if only one endpoint present while it says default is HTTP. #620
with regards to theMonitoring feature, the endpoint was defined with scheme http, but the serviceMonitor created was of scheme HTTPS causing it to not function as intended. Even if the scheme was left empty, the default as per the documentation is http but the serviceMonitor was of scheme https
What did you expect to see?
Expected to see http as the default scheme for ServiceMonitor created by the operator.
What did you see instead?
HTTPS was the scheme in the service monitor created by the operator
Environment
OpenShift
Possible solution
The issue is identified to be in the utils/utils.go file in line 1203-1207
The problem is solved if the tlsConfig of the first endpoint is not nil. So giving an empty value in any of the fields results in http scheme being used.
in the second if statement if there are no endpoints or if the first endpoint has no TLSConfig, it is setting the scheme to https. This is the issue that needs to be fixed.
Additional context
If there is only one intended end point and that has to be http then this logic does not allow the same.
@dhanush251201 TLS management (at both app level and the ServiceMonitor level) is enabled by default on the RuntimeComponent through the .spec.manageTLS flag.
So we override the ServiceMonitor endpoint to be https to correspond to the RuntimeComponent which is normal behavior from the operator. When setting .spec.manageTLS to false, it falls back to http, as per Prometheus docs.
However, I see that your issue is with the lack of customizability with the scheme forced to be https for the single ServiceMonitor endpoint. We can make it easier to allow opting-out of the https override for the endpoint but still have TLS managed on the RuntimeComponent app.
Activity
kabicin commentedon Apr 3, 2024
@dhanush251201 TLS management (at both app level and the ServiceMonitor level) is enabled by default on the RuntimeComponent through the
.spec.manageTLSflag.So we override the ServiceMonitor endpoint to be
httpsto correspond to the RuntimeComponent which is normal behavior from the operator. When setting.spec.manageTLStofalse, it falls back tohttp, as per Prometheus docs.However, I see that your issue is with the lack of customizability with the scheme forced to be
httpsfor the single ServiceMonitor endpoint. We can make it easier to allow opting-out of thehttpsoverride for the endpoint but still have TLS managed on the RuntimeComponent app.