We would like to add our own dashboards, rules, and alerts, but they are private, and we do not want them pushed upstream. We also want to be able to modify those made by kube-prometheus via jsonnet. To do these things, we are vendoring these helm charts as-is, then generating the json for these things via jsonnet with kube-prometheus, then finally piping them into a modified version of the hack scripts to create the templates for the helm charts.
If some of the heavy lifting (particularly the loops) were pulled into their own functions, then it would be easier to write slightly modified versions of the hack script, and I won't need to merge with updates pulled from upstream as often (that hasn't really been an issue, but if all the main functionality is available in specific functions, then I have more confidence that it won't be). It would be nice to just copy these hack scripts into my own python module for me to use the functions provided. I assume there would still be some churning as there's no API guarantees in these hack scripts, but it seems more manageable at a function-level.
This is the "easy" feature request, though I guess this leads to what I'm ultimately trying to achieve: the ability to add rules, dashboards, and alerts (as well as modify the ones from kube-prometheus), then easily be able to deploy them as part of the helm charts (with all the helm templating, etc.) without having to first push these somewhere public.
Is your feature request related to a problem? Please describe.
Having a "static" set of dashboards, rules, and alerts won't work for us. We need to be able to modify things in the jsonnet as well as add our own stuff. However, using helm is still a huge benefit, in terms of switching them on/off with the values.yaml and using helm templating for variables not known until deployment time (i.e. not known when the charts are generated with these hack scripts).
Describe the solution you'd like
For the easy solution, I would just like any loops or non-trivial functionality to be pulled into functions, so the main
function is simplified and I don't need to worry about having to merge things when pulling upstream changes as often.
Ultimately, I'm picturing these hack scripts basically being a helm chart "generator" (since helm natively doesn't support jsonnet or workflows like this), and I'd like to use functions from these hack.py
scripts to help with that.
Describe alternatives you've considered
We've considered using just kube-prometheus without helm, but given that kubectl apply --prune
is still alpha, helm seems to be best for packaging things. Plus the helm templating is a huge plus as well.
HTH make a PR for this.