-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: TLS support for the Prometheus web endpoint #492
Conversation
Hi @vyzigold. Thanks for your PR. I'm waiting for a rhobs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's be easier for reviewers if you split the PR: 1 for Alertmanager and 1 for Prometheus.
I removed the alertmanager bits from this PR and I'll create another PR with them shortly. This PR now includes only the Prometheus TLS implementation. I renamed the PR and rewrote the description accordingly. |
Thanks. I have only one comment regarding the Secrets api addition. Since OBO uses server-side-apply user should still be able to add secrets to that list by also user server-side-apply. If possible I'd like to avoid adding Secrets to the MonitoringStack API. |
Regarding the |
I don't think that using Regarding the SSA. I don't understand the comment about what's exactly missing upstream. Does it mean, that SSA won't work for .spec.secrets at the moment? I'll try and see if I can make it work, but I think I'll be pretty busy for the next 2 weeks unfortunately, so it might take me a little bit more time to get back to this. |
Thanks for your work on this, we much appreciate it! No worries if other priorities come up. The SSA comment refers to a missing kubebuilder annotation upstream. The secrets field needs to set the correct Regarding your quesiton about |
1405fa7
to
bc11d9c
Compare
I rebased on top of main, I hopefully fixed all the CI complaints. I removed the commit, which added the Secret to the api. At the moment the code works, but OBO takes ownership of the Prometheus's secret field and users aren't able to use SSA to add new secrets. As you mentioned in previous comments, we'll need some upstream changes for SSA to work for the secrets. |
I went ahead and created an upstream PR to add the +listType. I tested it together with this PR and it seems to work quite nicely. OBO would add whatever it needed to the secrets field and I was able to use SSA to add other secrets. OBO was able to remove the TLS secrets when I disabled TLS while leaving the manually added secrets intact and so on. |
Nice I think this |
@simonpasquier thank you for your suggestions. I rebased on top of main, included Simon's suggestions and regenerated the manifests / bundle. I'll do the same for the other 3 PRs |
Looks like the managed fields test was only half complete, for some reason I forgot to fully complete it. I switched it to deploy with TLS and added the expected fields to the expected json. I still have a difference between the expected managed fields and the managed fields from the test when running it locally.
But I don't see a reason why. AFAIK I didn't do anything with image and enabledFeatures. Maybe it's because I use crc for development instead of kind? |
I deployed in kind and rerun the tests. I can confirm, that the CI was green except for post-e2e, which I think doesn't matter until #200 is fixed. https://paste.opendev.org/show/bYHXIta79uQXR4q0Y9pU/ |
4610824
to
cc5e724
Compare
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jan--f, vyzigold The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR adds a new "WebTLSConfig" field to the PrometheusConfig section of the MonitoringStack CRD, which allows the user to specify secrets containing TLS certificates. The Prometheus object is configured to use these secrets. The feature is tested in a new "assertPrometheusScrapesItselfTLS" testcase.
I needed to add the secrets containing CA certificates to the "secrets" field in the Prometheus object in order to use them for the self scraping jobs. This means the "secrets" field is now managed by OBO, so I added a new "secrets" field to the MonitoringStack CRD, which gives the users the ability to specify additional secrets to mount into the prometheus container. Specifying additional secrets is one of the ways to configure TLS CAs for scraping.