Afaiu the spec is unclear whether to quote this or not. In this case
here is certainly not requires and works fine without. Additionally,
there is some tooling which does not treat quotes values correctly and
generates image links like
`quay.io/prometheus/golang-builder:\"1.23\"-base`.
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
This commit adds the option to reload Prometheus configuration using
signal instead of the /-/reload endpoint.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Share parsing for the logging flags across all binaries.
* Refactor and share the web server implementation between the operator
and the admission webhook.
* Refactor controller configuration structs to include only the required
parameters.
* Parse label and field selector arguments early instead of doing it in
each controller.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* config-reloader: change stderr to stdout
Changed all stderr logs to stdout and include levels too
* config-reloader: remove comment line
Remove comment live
* promcfg: change stderr to stdout
Changed on line 70 to os.Stdout
When a Prometheus pod is terminated, the container runtime sends a
SIGTERM signal [1] to all pod's containers. Prior this change,
prometheus-config-reloader would return a non-zero exit code in this
case which can lead to the pod being reported as failed for a brief
period of time and create additional work on the statefulset
controller's side. To be a good citizen, prometheus-config-reloader
should handle the signal and return gracefully.
[1] https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* config-reloader: add the reload-timeout argument
this new argument enables you to increase (or decrease) the duration for config-reloader to wait after Prometheus' reload
Fixes #5346
Remove tlsConfig struct in favor of inlining structs with literal
values. The InsecureSkipVerify field is not configurable and as
a result of this it can be set in the construct itself
Add test for HttpClient creation to ensure that the outcome is as expected.
Current downside is that the nested structs for Transport are not serialized in
readable format. They still contain the pointer value.
Remove the flag to make TLS skip verify toggleable. Leaving in the option struct.
Now TLS verification will always be skipped with the intent to not support standalone
application setups.
Using github.com/go-kit/log instead of github.com/go-kit/kit reduces the
list of things this project depends on. This commit also removes the
wrapper for k8s.io/klog because none of the k8s libraries depend on it
anymore.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This change gets rid of the additional reloader that was deployed in the
Prometheus pod to monitor rules file.
It also changes the Alertmanager and Thanos ruler statefulsets to use
the container image from the `--prometheus-config-reloader` flag instead
of `--config-reloader-image`. We pick `prometheus-config-reloader`
because it supports gzipped configuration file and is "smarter" about
when to reload the configuration (e.g. it checks that the content on
disk has effectively changed before reloading).
The `--config-reloader-image` of Prometheus operator is deprecated (e.g.
it isn't used anywhere by the operator) and it may be removed in a
future release (but not before v0.45).
Since the Prometheus config reloader doesn't watch only rule directories
anymore (e.g. for Alertmanager it watches mounted secrets), it gets a
new `--watched-dir` flag that replaces the `--rules-dir` flag.
Finally the config reloader can be configured to expose metrics with the
`--listen-address` flag. The metrics are:
* `reloader_config_apply_operations_failed_total`
* `reloader_config_apply_operations_total`
* `reloader_reloads_failed_total`
* `reloader_reloads_total`
* `reloader_watch_errors_total`
* `reloader_watches`
* `reloader_watch_events_total`
Signed-off-by: Simon Pasquier <spasquie@redhat.com>