1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-16 09:16:38 +00:00
Commit graph

620 commits

Author SHA1 Message Date
paulfantom
35b2954459
pkg/prometheus: remove liveness probe
Removing liveness probe to prevent killing prometheus pod during WAL
replay.

This should be reverted around kubernetes 1.21 release. At that point
startupProbe should be added.
2020-09-15 12:05:18 +02:00
Simon Pasquier
675d303ee0
pkg/prometheus: enable Thanos uploads only when needed (#3485)
When the Thanos spec doesn't configure object storage, there's no need to
configure the Thanos sidecar for block uploads and mount the
Prometheus data volume.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-09-11 16:16:19 +02:00
Sergiusz Urbaniak
34ba8237f5 pkg/informers: fix stylistic nits
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2020-09-04 17:08:33 +02:00
Sergiusz Urbaniak
2379f59f6f pkg/prometheus: check error immediately after List 2020-09-04 17:08:33 +02:00
Sergiusz Urbaniak
27c1680975 pkg/*: renamings and reformatting 2020-09-04 17:08:33 +02:00
Sergiusz Urbaniak
e9ad330bf8 pkg/prometheus: remove multilistwatcher 2020-09-04 17:08:33 +02:00
Simon Pasquier
053da63f0b *: pass context.Context to client-go functions
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-09-03 14:13:31 +02:00
Simon Pasquier
7ed47043ce Add tests for assetStore
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-08-31 14:51:30 +02:00
Simon Pasquier
a0a1816f4c Use cache.Store instead of custom stores 2020-08-31 10:51:09 +02:00
Simon Pasquier
caf6b9f3ce pkg/prometheus: skip invalid service monitors
Previously the operator would fail the reconciliation when a service
monitor was referencing a bad secret or configmap (either the object
didn't exist or the key was missing).

With this change, the operator will skip these service monitors.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-08-31 10:51:09 +02:00
Matthias Rampke
76d5211a6c
Avoid CI timeouts in TestConfigGeneration (#3432)
This test generates the same configuration many times, for each
Prometheus version, to see if it is deterministic. As the compatibility
matrix grows, test times increase. Now, this sometimes fails in CI
because Travis kills jobs after 10 minutes of no output.

Run each version as a subtest, and run tests with `-v`, so that output
is produced after each version. This avoids the no-output timeout.

Parallelize testing for each Prometheus version.

When the tests are run with `-short` (as in `make test-unit`), only try
one hundred iterations. With the race detector on, as in that target, this takes
around 5 seconds. Without the race detector, short tests on this
package now run quick enough for fast iteration in an IDE.

Add an additional target and Travis job for running the long tests, but
without the race detector. This brings the run time for the full 1000
iterations per version to under a minute.

Signed-off-by: Matthias Rampke <matthias@rampke.de>
2020-08-28 14:53:32 +02:00
Simon Pasquier
e64718cb6b
pkg: add prometheus_operator_reconcile_operations_total metric (#3415)
* pkg: add prometheus_operator_reconcile_operations_total metric

We already have the `prometheus_operator_reconcile_errors_total` metric
to track the number of reconciliation attempts that failed but we miss
the number of attempts which makes it harder to alert on it. With this
change, we can compute the ratio of reconciliations that failed.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Update alert definition with new metric
2020-08-19 16:41:02 +02:00
Sergiusz Urbaniak
54704fac8f
Merge pull request #3392 from lilic/fix-image-tag-version
pkg/operator/image.go: Adjust image path building
2020-08-11 10:43:24 +02:00
Lili Cosic
7b4a9d740d pkg/prometheus/statefulset_test.go: Adjust tests 2020-08-10 14:49:55 +02:00
Lili Cosic
49e2842c49 pkg/alertmanager,thanos,prometheus: Adjust usage 2020-08-10 14:49:55 +02:00
郑佳金
9c066705a4 feat: support special post alerts timeout 2020-08-06 16:59:15 +08:00
paulfantom
67780ccc45
repository migration to prometheus-operator organization 2020-08-05 13:13:46 +02:00
Noah Kantrowitz
41c2202698 🐛 Don't overwrite __param_target
It is already set above using the sd metadata, no need to overwrite it back to __address__.
2020-08-01 23:15:58 -07:00
Frederic Branczyk
f6b342d3f7
Merge pull request #3364 from coreos/revert-3308-normalize-default-durations
Revert "Normalize default durations"
2020-07-27 11:38:28 +02:00
Frederic Branczyk
f1e0131c1b
Merge pull request #3358 from jbfavre/fix_prometheus_version_propagation
Propagate Prometheus image version to statefulset
2020-07-27 11:20:16 +02:00
Frederic Branczyk
024da7b667
Fix expected default probe scrape interval 2020-07-27 10:29:46 +02:00
Frederic Branczyk
1d00eeb962
Revert "Normalize default durations" 2020-07-27 07:42:21 +02:00
Jean-Baptiste Favre
c710ec3e39 Fix Go gormat 2020-07-24 14:14:13 +02:00
Jean-Baptiste Favre
dc2a4527c2 Improve unit tests for Version, Tag & SHA matrix 2020-07-24 14:07:58 +02:00
Simon Pasquier
2021270248 pkg: instrument resources being tracked by the operator
This change adds a new `prometheus_operator_resources` metric that keeps
track of the number of resources currently managed by the operator. The
metric is broken down by controller and type of resource.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2020-07-24 13:39:01 +02:00
Jean-Baptiste Favre
13aa36a8a4 Ensure image version is taken into account when using new spec.Image values 2020-07-24 09:40:35 +02:00
Mathis Raguin
87d8b8cd47
prometheus/operator: add SecretListWatchSelector
Signed-off-by: Mathis Raguin <mathis@cri.epita.fr>
2020-07-22 17:13:34 +02:00
Frederic Branczyk
a821bf5d32
Merge pull request #3249 from ybettan/devel
Added support for configuring CA, cert, and key via secret or configmap.
2020-07-15 09:19:07 +02:00
Yoni Bettan
be0bf2fc26 Added support for configuring RemoteWrite TLS via Secret or Configmap.
Now we can configure the operator to use mTLS RemoteWrite by referencing
the CA, cert and key directly from k8s Secrets/ConfigMaps.

If the key and the cert are both Secrets, they can exist as a single
Secret which contain both 'cert.pem' and 'key.pem' otherwise they can
exist as 2 different Secrets (or a Secret for the key and ConfigMap for
the cert).

Signed-off-by: Yoni Bettan <ybettan@redhat.com>
2020-07-12 14:42:17 +03:00
Paul Gier
a5c0ba61c4 pkg/operator: consolidate image url logic
Move logic for building image URLs into the operator package.
This improves the consistency for building image URLs from the
combination of default settings, operator CLI args, and config in the
custom resources.
2020-07-09 17:53:18 -05:00
yeya24
fa3164e0a5 support job name in probe
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-07-05 23:45:13 -04:00
Frederic Branczyk
a819cd5497
Merge pull request #3312 from yeya24/fix-probe-ingress
Fix probe ingress configs
2020-07-03 17:14:41 +02:00
yeya24
dc4036e6ff fix probe ingress configs
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-07-03 09:49:52 -04:00
Frederic Branczyk
d220dad394
pkg/prometheus: Ensure relabeling of container label in ServiceMonitors
PodMonitors already default to relabeling namespace, pod and container
into the target labels. ServiceMonitors should do the same to allow easy
correlation between signals.
2020-07-03 12:51:03 +02:00
Frederic Branczyk
a7e60b2600
Merge pull request #3308 from wiardvanrij/normalize-default-durations
Normalize default durations
2020-07-01 08:24:48 +02:00
yeya24
915f1838fc fix probe promcfg
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-06-30 09:59:31 -04:00
Wiard van Rij
da7c565fd4 fixes test cases 2020-06-30 15:01:24 +02:00
Wiard van Rij
fd2fb741d1 set scrapeInterval and evaluationInterval to 1m 2020-06-30 14:19:34 +02:00
Frederic Branczyk
6cb9595ccf
pkg/prometheus: Allow enforcing namespace label in Probe configs 2020-06-29 20:50:52 +02:00
Arno Uhlig
35fd2dd9e4 rename blackbox to probe
Signed-off-by: Arno Uhlig <arno.uhlig@sap.com>
2020-06-27 20:33:03 +02:00
Arno Uhlig
536493a8be blackboxMonitor
Signed-off-by: Arno Uhlig <arno.uhlig@sap.com>
2020-06-27 20:30:48 +02:00
Miklós Kiss
45de764e39
refactor: decouple pod labels from selector labels (#3294)
* refactor: decouple pod labels from selector labels

prometheus pods can not be rolled out without downtime when label's are changed

Fixes #3120

* chore: run go fmt

* fix unit tests
2020-06-25 10:41:17 +02:00
yeya24
7d2da4fa51 add allow-overlapping-blocks
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-06-19 17:23:55 -04:00
Lili Cosic
3227239bc5 pkg: Add EnforcedSampleLimit which enforces a global sample limit
for each ServiceMonitor or/and PodMonitor. EnforcedSampleLimit is taken
in favour of any SampleLimit set per ServiceMonitor or/and PodMonitor
resource. This is meant to be used by admins to be able to enforce a
limit of samples/series for each target.
2020-06-15 14:27:07 +02:00
Carlos de Paula
9e1414e283 Add scrapeTimeout as global configurable parameter
Add global configurable scrapeTimeout parameter to allow monitoring
targets on clusters consisting of slower hosts like Raspberry Pi and
many ARM boards used for labs.

Signed-off-by: Carlos de Paula <me@carlosedp.com>
2020-06-07 18:09:27 -03:00
Amr Hanafi (MAHDI))
cb8c56e373 [thanos-sidecar] Add minTime arg 2020-05-28 12:27:59 -07:00
ston1th
e9207c8cb2 thanos sidecar: log flags double definition
This fixes a double definition of the `--log.level` and `--log.format`
flags in the thanos sidecar.

Fixes #3222
2020-05-25 17:47:00 +02:00
Severyn Lisovskyi
9877ec897f
add ability to exclude rules from namespace label enforcement (#3207)
* add ability to exclude rules from namespace label enforcement

* fixup! add ability to exclude rules from namespace label enforcement

* fixed TestEnforcedNamespaceLabelRule

* fixup! add ability to exclude rules from namespace label enforcement

* add tests for LabelEnforcementExcludeList

* fixup! add ability to exclude rules from namespace label enforcement

* fixup! add ability to exclude rules from namespace label enforcement

* moved enforceNamespaceLabel to shared pkg

* fixup! moved enforceNamespaceLabel to shared pkg

* fixup! moved enforceNamespaceLabel to shared pkg

* Trigger build once more

* fixup! add ability to exclude rules from namespace label enforcement

* fixup! moved enforceNamespaceLabel to shared pkg

* fixup! moved enforceNamespaceLabel to shared pkg
2020-05-20 15:55:05 +02:00
vas
973bbca6cd Update for prometheus-2.18 2020-05-16 17:43:57 +01:00
Sergiusz Urbaniak
6f09dd569c
Merge pull request #3182 from simonpasquier/issue-3181
*: create separate namespace informers if needed
2020-05-06 09:02:43 +02:00