-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve scaffolding of ServiceMonitor #3657
Comments
Hi @fgiloux, Thank you for bringing attention to this. I have a couple of questions regarding the configuration snippet you provided:
I'm raising these concerns because upcoming changes in the auth-proxy will also demand a certificate. It seems that the primary reason the auth-proxy no longer generates a default certificate when none is provided is due to security concerns. Given this, we might need to re-evaluate our approach. Your insights on how these values should be provisioned would be immensely valuable as we move forward. Looking forward to hearing your thoughts on this. Best regards, |
Btw, if you have any ideas, or suggestions in mind and would like to push a pull request your collaboration is more than welcome. |
I hope you are doing well.
these are the key for the CA certificate and name of the secret containing it that are already scaffolded for kube-rbac-proxy. This is what is needed by Prometheus to check the server identity as part of the TLS hand-check.
There has to be something providing the certificates and currently Kubebuilder is using cert-manager.
I would argue that this change reduces manual configuration rather than increases it as it eliminates manual changes for properly handling TLS and avoiding Prometheus credentials being exposed.
I am not sure what you are referring to. The intent of this issue is an incremental improvement, not a redesign. I am happy to look at creating a pull request but would like first that there is an agreement on the change. |
Hi @fgiloux Following are some comments that I hope bring some context. Webhooks & Cert-Manager
Considering Prometheus Implementation
Challenges with Controller-Runtime & Kube-Rbac-Proxy
Therefore, the above creates some overlap and challenges in determining our direction. Kubebuilder cert-manager, auth-proxy and Prometheus options came from the legacy layout without plugins In the past, we did have not a plugin ecosystem. Therefore, we have all scaffolded and the options to comment and uncomment them. So, we might need to ask: Shouldn't those become optional plugins? I think we might need to move in this direction:
Making third-party be enabled by default
|
Hi @fgiloux, Your request here should be addressed in the Phase 2 of the plan to Discontinue Kube RBAC Proxy in Default Kubebuilder Scaffolding. See: #3871 So, I am closing this one in favor of PEP and the above issue. |
What do you want to happen?
Currently the scaffolding of ServiceMonitor makes use of Prometheus in-cluster credentials for collecting metrics. In some Prometheus installation it is not allowed, i.e. the setting is ignored for security reason:
A problem with the approach is that Prometheus token is exposed to the user creating the ServiceMonitor. With this token the user would be able to query any metrics endpoint Prometheus has access to.
Another issue is that insecureSkipVerify is used, which deactivates an important mechanism to check that the server reached is what it pretends to be.
My use case is really about:
It is not related to a particular Kubernetes version.
After a quick search I am not aware of another issue associated with this.
I am proposing to create an additional service account and token secret, used for scrapping the operator metrics. This can then get referenced in the ServiceMonitor resource.
In a similar way the TLS certificates generated to secure the operator endpoint can be referenced in the ServiceMonitor to guarantee the authenticity of the server to Prometheus.
Extra Labels
No response
The text was updated successfully, but these errors were encountered: