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

249 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
Lili Cosic
49e2842c49 pkg/alertmanager,thanos,prometheus: Adjust usage 2020-08-10 14:49:55 +02:00
paulfantom
67780ccc45
repository migration to prometheus-operator organization 2020-08-05 13:13:46 +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
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
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
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
Paul Gier
01f49eb0a4 types: use custom type for embedded persistent volume claims
This allows nested PersistentVolumeClaim fields to be validated and
maintain metadata information such as labels and annotations.

Signed-off-by: Paul Gier <pgier@redhat.com>
2020-04-28 10:17:34 -05:00
Barthelemy Vessemont
9cd369c090 Add a disable subPath flag for prometheus-db volume 2020-04-17 12:19:53 +02:00
Paul Gier
9caf7f0e33 add log level and format fields to thanos sidecar 2020-04-03 10:13:55 -05:00
Paul Gier
e42b3d6e5a use tolerant parsing of version strings
From the godoc:

ParseTolerant allows for certain version specifications that do not
strictly adhere to semver specs to be parsed by the semver library.
It currently trims spaces, removes a "v" prefix, and adds a
0 patch number to versions with only major and minor components specified.
2020-03-26 15:41:28 -05:00
Paul Gier
2cc4efc626 consolidate container image defaults
This moves the default image versions and urls from multiple
packages into a single location in the operator package.
This has the advantage of easier maintenance and ensuring that
the default Thanos sidecar image doesn't become out of
sync with the default image used for Thanos Ruler.
2020-03-16 11:41:17 -05:00
paulfantom
993c460d33
pkg/apis/monitoring/v1,pkg/prometheus: add support for VolumeMounts in Prometheus CRD 2020-03-13 14:02:04 +01:00
Paul Gier
d27008fb7a
GRPC TLS config for Thanos Ruler and Sidecar (#3075)
* pkg/thanos: add grpc-server-tls config

* pkg/prometheus: add grpc-server-tls config to thanos sidecar

* update generated files for thanos grpc tls config
2020-03-11 11:16:45 +00:00
Paul Gier
a9ab71c6ec update thanos to v0.11.0 2020-03-05 14:57:46 -06:00
Paul Gier
cf93eced12 support Prometheus v2.16.0 2020-02-28 10:55:23 -06:00
Paul Gier
e4794d36d0 remove unnecessary local variable 2020-02-20 17:20:59 -06:00
Paul Gier
c23ca4aa93 update default image versions
Prometheus image should default to latest version in compatibility
matrix.  Also updates Alertmanager and Thanos to latest stable versions.
2020-02-06 20:08:06 -06:00
Lili Cosic
700ad6550f
Merge pull request #2998 from LiliC/update-prom-matrix
pkg/prometheus/statefulset.go: Bump versions of prometheus in CompatibilityMatrix
2020-02-03 19:29:36 +01:00
Lili Cosic
8bd1f4c53c pkg/prometheus/statefulset.go: Bump versions of prometheus in CompatibilityMatrix 2020-02-03 17:12:09 +01:00
yeya24
d637e65ac5 support thanos tracing
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-02-03 09:50:41 -05:00
yeya24
3f37f9ba2f fix typo kuberentes
Signed-off-by: yeya24 <yb532204897@gmail.com>
2020-01-31 22:56:18 -05:00
Elisiano Petrini
752c49e819 prometheus-operator: set config-reloader containers resources
Currently when passing `--config-reloader-(cpu|memory)` values those are
used only for limits. This PR sets the same values for requests.
I wasn't sure if the options for the requests should have been passed
with separate options but I thought this was a good compromise in the
meantime.

The initial question was brought up in https://github.com/coreos/kube-prometheus/issues/376
2020-01-16 08:49:57 +01:00
Julian Taylor
2aa5bbba08 fix generated statefulset being pruned by kubectl
When the operator transfers all labels and annotations from the source
prometheus object to the generated statefulset this also kubectl managed
annotations.
These annotations will cause the generated statefulset to be pruned when
the source prometheus is applied with kubectl apply --prune.
Cleanup of the statefulset is managed by the garbage collection via
owner references of the prometheus object (which can be pruned).

To fix this do not transfer any kubectl.kubernetes.io/ annotations to
the generated statefulset.

Closes gh-2642

Signed-off-by: Julian Taylor <juliantaylor108@gmail.com>
2020-01-09 18:59:16 +01:00
Karl-Fried Eisenhauer
319ad158f0 operator: modified prometheus wget probe when listenLocal
When using prometheus with listenLocal=true the wget probe in the pod
failed because the created download file prenvents further successfull
wget runs.
Using /dev/null for the wget output file fixes that.

Fixes #2921
2019-12-31 14:20:34 +01:00
Jean-Philippe Braun
5e5aba143f Allow to configure PVC access mode
Fixes #978
2019-12-13 11:26:32 +01:00
Renju George
ecd8fd98bd option to disable prometheus compaction 2019-12-03 11:12:27 +00:00
Simon Pasquier
780fb25e9e Add APIVersion field to Prometheus.Spec.Alerting
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2019-11-27 15:35:32 +01:00
vas
0e51f68949 Fix time 2019-11-15 11:30:26 +00:00
Bartlomiej Plotka
78a8889a06
Do not disable compaction on sidecar without object storage configuration (#2845)
* Do not disable compaction on sidecar without object storage configuration.

... as it's not required (:


Also:
* updated Thanos docs!
* added tests
* bumped default image.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Addressed comments.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>

* Update pkg/prometheus/statefulset.go

Co-Authored-By: Lili Cosic <cosiclili@gmail.com>

* Reverted prom to 2.7.1

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
2019-11-04 11:11:09 +00:00
Frederic Branczyk
395c1df715
*: Ensure containers have "FallbackToLogsOnError" termination policy 2019-10-18 11:19:58 +02:00
paulfantom
50ba40891f
pkg/prometheus: do not prefix config secret name as it breaks some upgrade scenarios 2019-10-07 13:07:27 +02:00
Max Leonard Inden
fd92cbfe94
pkg/prometheus: Enable users to configure bearer token from secret
To configure a bearer token users could only specify a file path in the
service monitor, pointing to a bearer token file in the Prometheus
container. This enables hostile users, being able to configure a service
monitor and controlling the scrape target, to retrieve arbitrary files
in the Prometheus container.

In cases where users can not be trusted, this patch adds an option to
disallow the above file path specification and replaces it by a secret
reference. This secret has to be in the same namespace as the service
monitor, shrinking the attack vector.

pkg/prometheus: Add option to deny file system access through service monitors

ArbitraryFSAccessThroughSMsConfig enables users to configure, whether
a service monitor selected by the Prometheus instance is allowed to use
arbitrary files on the file system of the Prometheus container. This is
the case when e.g. a service monitor specifies a BearerTokenFile in an
endpoint. A malicious user could create a service monitor
selecting arbitrary secret files in the Prometheus container. Those
secrets would then be send with a scrape request by Prometheus to a
malicious target. Denying the above would prevent the attack, users can
instead use the BearerTokenSecret field.

test/basic-auth-test-app: Add mTLS endpoint

pkg/prometheus: Enable users to configure tls from secret

pkg/prometheus/operator: Validate TLS configs before retrieving assets

Before retrieving TLS assets from Kubernetes secrets for a given service
monitor, make sure the user did not specify both file and secret
reference, e.g. both `CAFile` and `CASecret`.

test: Rename basic-auth-test-app to instrumented-sample-app

Given that the basic-auth-test-app not only supports basic auth, but
also bearer token as well as tls authentication, this patch renames the
app to a more generic name.

test/e2e/prometheus_test: Test ArbitraryFSAccessThroughSM option for tls

The Prometheus custom resource has the option to disable arbitrary
filesystem access configured through service monitors. This commit adds
an end-to-end test for this option in combination with the TLS
configuration via files or secret references in service monitors.

pkg/prometheus/operator: Move check for arbitrary fs access into func
2019-10-07 13:07:05 +02:00
Guy Templeton
67bccfd45b Add ListenLocal option for Thanos spec to listen on local loopback (#2728)
* Add ListenLocal option for Thanos spec to listen on local loopback

Resolves #2435

* Generated files
2019-10-02 18:09:27 +01:00
Matthias Loibl
5eb9cb53db
Add script using either curl or wget to probe, or failing completely 2019-09-23 18:38:20 +02:00
Matthias Loibl
e169f9527a
Add exec probes with wget localhost:9090 to Prometheus if listenLocal 2019-09-17 19:09:57 +02:00
Sergiusz Urbaniak
86d42de53c pkg/prometheus: add Thanos service port to governing service
Currently, for service discovery of Prometheus instances
a separate headless service must be deployed.

This adds the Thanos grpc port to the existing Prometheus statefulset governing service
if a Thanos sidecar is given in the Prometheus custom resource specification.

This way no additional service has to be deployed.
2019-09-10 16:33:01 +02:00
yeya24
a48fa76630 bump thanos image and version
Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-09-03 15:18:50 -04:00
Lukas Grossar
7016041999
pkg/prometheus: add support for initContainers
Add support for configuring initContainers
2019-08-28 14:24:10 +02:00
Ryan Chapple
d5341ab70f
Adding Volumes to PrometheusSpec
Added ability to express additional Volumes on the PrometheusSpec object, and to have those Volumes propagated out to the generated StatefulSet config.
2019-08-26 17:42:41 -07:00
Victor Palade
7fc72cb923
thanos: expose metrics endpoint
Whilst the service port is created by default, the metrics endpoint for the sidecar is never started.
2019-08-13 10:10:48 +02:00
Mike Bryant
f7a3920e4a feat: Make governing services port name configurable
Allow changing the port name to http, to be compatible with istio's port naming requirements
2019-08-08 08:49:31 +01:00
Chris Marchbanks
454962a809
Provide option to turn on WAL compression
Signed-off-by: Chris Marchbanks <csmarchbanks@gmail.com>
2019-07-22 11:44:14 -06:00
paulfantom
ac7626c151
pkg/alertmanager: change podManagement policy to parallel to prevent statefulset reconciliation from hanging
When using default podManagementPolicy it is possible to create a
situation where alertmanager pods objects won't be reconciled with a
statefulset and thus preventing am from being deployed.

One of such cases is when am was deployed and afterwards admin
applied taints to all nodes causing pod eviction. Next tolerations were
applied however due to OrderedReady policy one am pod was still left in
Pending state preventing reconciliation.

This is needed to provide a workaround for a bug in kubernetes detailed
in https://github.com/kubernetes/kubernetes/issues/60164. It is also one
of the knows limitations of StetafulSets mentioned in docs
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations
2019-07-17 14:57:49 +02:00
Benjamin
a9fa9b9e42 Add more recent prometheus versions to compatibility matrix
Signed-off-by: Benjamin <benjamin@yunify.com>
2019-07-05 18:58:56 +08:00
Andy Bursavich
d3a71c5ba8 thanos: upgrade dependency and default to v0.5.0 2019-06-06 08:05:31 -07:00
Andy Bursavich
901346bd55 thanos: remove deprecated features and require v0.4.0+ 2019-06-05 20:49:30 -07:00