Open TiagoJMartins opened 2 weeks ago
Welcome @TiagoJMartins! It looks like this is your first PR to falcosecurity/charts 🎉
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: TiagoJMartins Once this PR has been reviewed and has the lgtm label, please assign issif for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
And what about removing the hard-coded annotation and putting it by default in .Values.service.annotations
?
What type of PR is this?
/kind bug /kind chart-release
Any specific area of the project related to this PR?
/area falcosidekick-chart
What this PR does / why we need it:
We are working on a migration from a deprecated Prometheus setup to one based on the Prometheus Kubernetes Operator. Since metrics scraped by the operator-managed instances are targeting ServiceMonitor and PodMonitor resources, we need to be able to configure the
prometheus.io/scrape
Service annotation to gradually disable scraping from our deprecated instances.Which issue(s) this PR fixes:
Because the
prometheus.io/scrape
annotation is hard-coded in the Service template and it's the last entry in theannotations
map, there's no way to include custom values after it.This PR simply moves the hard-coded annotation to before the user-provided values, so at least they have an escape hatch in case they need to override the value.
Special notes for your reviewer:
You can test with:
The final template will include duplicate values, but the override will take precedence when the yaml gets parsed/applied to the cluster.
The duplicated keys will be removed by the cluster.
I considered going with a different approach based on something like
.Values.service.prometheusScrape
, but decided against it due to it requiring changes to thevalues.yaml
structure.Checklist