appliance: deploy prometheus#62876
Conversation
There was a problem hiding this comment.
Could we use a finalizer to clean these up? It might be difficult to manually keep "ownership" of it though 🤔
There was a problem hiding this comment.
Good idea! I wrote this up and split it out into https://linear.app/sourcegraph/issue/REL-92/investigate-should-we-try-to-clean-up-cluster-scoped-resources, because I'm unlikely to get to it today, and I want to land the golden file formatting part of this PR so that I don't get conflicts with other service definition PRs that come through in the next few days. In hindsight this would have been a good use for a stack 😅
0e8c069 to
8fe4d9d
Compare
jdpleiness
left a comment
There was a problem hiding this comment.
😅 that was a long one, but not too bad. I made a few comments, but nothing blocking. I did skim more lightly than normal over the yaml testing pkg as well.
First function: ConvertYAMLStringsToMultilineLiterals.
Disable it in all current golden tests.
Standardize indentation and represent multiline strings as literals. This makes diffs of large nested documents easier to read (e.g. the prometheus configmap).
Optionally provision RBAC with cluster-level privileges, and corresponding scrape config. Due to kubernetes rules around namespaced objects not owning namespaced ones, our ConfigMap cannot own the ClusterRole(Binding)s provisioned by this config. As such, they will not be garbage-collected when the ConfigMap is deleted. These cluster-scoped resources are given a qualified metadata.name, in order to minimise the risk of clashing with existing non-namespaced resources.
Rather than creating one.
I thought a generic map function was added to the Go stdlib recently, but I was wrong.
04a3475 to
506aff0
Compare
|
Caution License checking failed, please read: how to deal with third parties licensing. |
1 similar comment
|
Caution License checking failed, please read: how to deal with third parties licensing. |
It's not particularly generic.
ca725dc to
b768057
Compare
Closes https://linear.app/sourcegraph/issue/REL-15/service-definition-prometheus
This is a very large PR (sorry!). I highly recommend reviewing one commit at a time, reading the commit messages. I presented it as one, rather than a stack, because I suspect the history won't be that useful after review, and can probably be squashed. Holler if this is just too much, I'm happy to split it up into a stack if need be.
Please see self-review notes too.
Changelog:
New YAML package to hold yaml-related utilities
First function: ConvertYAMLStringsToMultilineLiterals.
appliance: remove getter method for pgsql config
In favor of just accessing the package-level variable.
appliance: add Prometheus config element
Disable it in all current golden tests.
appliance: deploy Prometheus
appliance: preserve multiline literals in golden fixtures
appliance: compare-helm: normalize yaml
Standardize indentation and represent multiline strings as literals.
This makes diffs of large nested documents easier to read (e.g. the
prometheus configmap).
appliance: compare-helm: allow cleanup to run when diff exits non-zero
appliance: prometheus privileged config
Optionally provision RBAC with cluster-level privileges, and
corresponding scrape config.
Due to kubernetes rules around namespaced objects not owning namespaced
ones, our ConfigMap cannot own the ClusterRole(Binding)s provisioned by
this config. As such, they will not be garbage-collected when the
ConfigMap is deleted. These cluster-scoped resources are given a
qualified metadata.name, in order to minimise the risk of clashing with
existing non-namespaced resources.
appliance: prometheus can optionally reference an existing configmap
Rather than creating one.
Test plan
Golden tests included.