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

393 commits

Author SHA1 Message Date
Arthur Silva Sens
cc47b1e160
Prometheus Agent support (#5385)
* Introduce PrometheusAgent CRD

Operator is able to run with PrometheusAgent resources in the cluster, but doesn't do anything with them yet. This is the first step to implement the Prometheus Agent Operator.

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Re-enable configmap and secret informers

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 1a71db03db6b41cd0cee9d0193b6ea3884bb5bae)

* Implement Resolve for Agent operator

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 49558165b9178b6c1bda833a48f7bfe1468c942a)

* Operator is able to create Agent Statefulset

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 7a3826683c92f917312c866a2bb6401dc54b95f2)

* Agent Operator creates secret from ServiceMonitors

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 11232669befb4de9d0765dfadfe5fae00b575f11)

* Agent Operator creates secret from PodMonitors

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 5ae551734bac2babc056c86443d15729d43d12b0)

* Agent Operator creates secret from Probes

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 9637612fbbe9617335fd6188271ebf2cc74a3693)

* Agent Operator configures remote-write

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit c4bdf230d527e19f8b77ca5f938b9254ed344f7d)

* Agent Operator configures additionalScrapeConfigs

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit d9f28db764641e682bf4fe8963310f791979c387)

* Implement UpdateStatus

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit c546ecaf3e8b73916df44a8f48b279c6988e32f5)

* Add resource handlers

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 5b83359445e20f88ea5fff80302fce62d58058b9)

* make format

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
(cherry picked from commit 6507964ba28f4ebf32ce3203db752444e288c45d)

* Only start agent operator if there is enough permission

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Remove node endpoint syncronization from agent operator

The server operator already handles it

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* Move PrometheusAgent API from v1 to v1alpha1

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* pkg/prometheus/agent/statefulset.go: Fix image concatenation

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* Avoid name colisions between Prometheus Agents and Servers

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* agent/createOrUpdateConfigurationSecret: Do not handle case where servicemonitor and podmonitor selectors are empty

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* make format

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* make --always-make format generate

Signed-off-by: ArthurSens <arthursens2005@gmail.com>

* Remove unused fields from Operator struct

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Add deployment mode as new selector label for agent/server ssts

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* WIP: Fix OperatorUpgrade e2e test

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Panic if type casting PrometheusInterface doesn't return Prometheus/Agent

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Detect whether PrometheusAgent CRD is installed or not

If the operator's service account has all permissions on the cluster and
the CRD isn't installed then the PrometheusAgent controller will run
but fail because of the absence of the CRD.

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

* Create dedicated governing service for Prometheus agent

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

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: ArthurSens <arthursens2005@gmail.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-03-27 12:30:01 +02:00
Mohamed Chiheb Ben Jemaa
a9206d6250
Add OpsGenieAPIURL OpsGenieAPIKey to global config (#5422)
* Add OpsGenieAPIURL OpsGenieAPIKey to global config

* Generate missing fields
2023-03-21 11:41:19 +01:00
Tommy Sauer
e2ce57ad6c
add thanos config_timeout and config_interval args (#5399)
* add thanos config args

Introducing missing arguments for thanos config interval and timeout.
https://github.com/thanos-io/thanos/pull/5573

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-03-13 14:02:46 +00:00
Mohamed Chiheb Ben Jemaa
b2bc0895a3
Add SlackAPIURL to Alertmanager global configuration (#5383)
* Add SlackAPIURL to Alertmanager global configuration

Signed-off-by: Mohamed Chiheb <mohamed@giantswarm.io>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-03-10 10:23:12 +01:00
Simon Pasquier
f337e4ecf8
Merge pull request #5350 from simonpasquier/default-port-name
api: define default value for `spec.portName`
2023-02-24 14:06:45 +01:00
Simon Pasquier
ba66d85cf6 api: define default value for spec.portName
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2023-02-22 11:14:35 +01:00
SuperQ
eb21ea9984
apis: Add Thanos BlockSize control
Add a BlockSize param to the ThanosSpec to allow configuration of the
Prometheus min/max block duration when using the Thanos Sidecar.

Fixes: https://github.com/prometheus-operator/prometheus-operator/issues/4414

Signed-off-by: SuperQ <superq@gmail.com>
2023-02-22 10:45:26 +01:00
Sviatoslav Dumchenko
0d2893232a
config-reloader: add init-config-reloader to alertmanager
this ensures there is no race between alertmanager and config-reloader
generating config during initial launch

Fixes #5357
2023-02-21 00:56:30 +04:00
Guillaume Hérail
e70b29a007 docs: Reword deprecation notices on *MonitorSelector/probeSelector
Fixes #5300

Co-authored-by: JoaoBraveCoding <jmarcal@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2023-01-24 14:41:12 +01:00
Guillaume Hérail
dffb3fcd27 feat: Add spec.AdditionalArgs to ThanosRuler
Fixes #5260
2023-01-23 14:25:40 +01:00
Simon Pasquier
8cebe1b49d
Merge pull request #5270 from simonpasquier/alertmanager-status
feat: add Alertmanager's status subresource
2023-01-20 08:58:17 +01:00
Simon Pasquier
400966bf31 chore: bump Kubernetes dependencies to v1.26.1
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2023-01-19 16:04:21 +01:00
Simon Pasquier
d078b93b36 feat: add Alertmanager's status subresource
Following #4580, this change implements the status subresource for the
Alertmanager CRD.

Co-authored-by: JoaoBraveCoding <jmarcal@redhat.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2023-01-12 10:00:08 +01:00
Joao Marcal
a717b1e03b
Adds Spec.Web.MaxConnections to Prometheus CRD (#5175)
* Adds Spec.Web.MaxConnections to Prometheus CRD

Issue: https://github.com/prometheus-operator/prometheus-operator/issues/4850

Problem: currently the Prometheus CRD only allows users to configure the
flag web.max-connections using Spec.AdditionalArgs

Solution: introduce dedicated support for the flag under
Spec.Web.MaxConnections

* Adds e2e test for max-concurrency and max-connections

* Renamed UniqueVolumeName to UniqueDNS1123Label and VolumeName to
DNS1123Label

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2023-01-09 16:52:54 +01:00
Calle Pettersson
f5440e26ff
Enforced pod target labels (#5206)
* Add GlobalPodTargetLabels configuration

* Update generated code

* Rename GlobalPodTargetLabels->EnforcedPodTargetLabels

* Rename EnforcedPodTargetLabels->PodTargetLabels
2023-01-04 16:52:26 +01:00
Simon Pasquier
f05c64c74d
Merge pull request #5198 from ghpr-asia/active_time_intervals_crds
pkg: Support active_time_intervals in AlertmanagerConfig CRD
2022-12-12 15:23:33 +01:00
Michal Schott
8309d19658
Added ability to specify imagePullPolicy (#5203)
* Added ability to specify imagePullPolicy

* Typo fix

* Tests update

* Moved imagePullPolicy option to different config struct

* tests update

* Update pkg/apis/monitoring/v1/types.go

Co-authored-by: Simon Pasquier <spasquie@redhat.com>

* make generate

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-12-09 23:13:42 +00:00
vladimir.ivanov
0c4f7886ea
pkg: Support active_time_intervals in routes CRD
Fixes #4656

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-12-09 21:30:57 +08:00
Joao Marcal
54b2513868
Improves comment on field MinReadySeconds for CommonPrometheusFields and AlertmanagerSpec (#5166)
* Improves comment on field MinReadySeconds for CommonPrometheusFields and
AlertmanagerSpec

Issue: https://github.com/prometheus-operator/prometheus-operator/issues/5067

Problem: the field StatefulSetMinReadySeconds was introduced in 1.22 and
until 1.25 where it stoped being alpha this field is not reset in the
statefulset code, this makes it so if the field is specified and the
feature gate is not enabled the stateful will just crash loop

Solution: improve the field comments to prevent users from using it if
the feature is not enabled

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2022-11-25 14:38:04 +01:00
Joao Marcal
e88999be1e
docs: Improves StorageSpec documentation (#5167)
* Improves StorageSpec documentation

Issue: https://github.com/prometheus-operator/prometheus-operator/issues/4922

Problem: StorageSpec defines the API for both Prometheus and
Alertmanager but the comments only mentioned Prometheus. Furthermore
a hint was added for those who would like to controll Volume management
outside of the CRs

Solution: improve API documentation

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2022-11-24 09:31:24 +00:00
Joao Marcal
ba18c61310
Adds basicAuth to AlertmanagerEndpoints (#5170)
* Adds basicAuth to AlertmanagerEndpoints

Issue: https://github.com/prometheus-operator/prometheus-operator/issues/4892

Problem: prometheus-operator implements multiple authentication methods
for Prometheus to authenticate with Alertmanager instances but it does
support basicAuth

Solution: this PR introduces basicAuth to the type AlertmanagerEndpoints

* Refactors all BasicAuth configuration in promcfg.go to start using
addBasicAuthToYaml

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2022-11-24 10:09:20 +01:00
Simon Pasquier
79994efecb
Merge pull request #5177 from slashpai/tr_version
pkg/apis: Add Thanos version field to CRD
2022-11-22 14:46:09 +01:00
Jayapriya Pai
b81c37f8f2
pkg/apis: Add Thanos version field to CRD
Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2022-11-21 15:55:21 +05:30
Fr3574
03fd369b4d
add alertmanagerConfigMatcherStrategy toggle to disable namespace matchers (#5084)
Co-authored-by: Frederik Stalschus <frederik.stalschus@sap.com>
2022-11-17 16:26:27 +01:00
Simon Pasquier
f7112ac696
Merge pull request #5152 from husira/fix-issue-5146
pkg/promcfg: Add support for enableHttp2 flag in AlertingEndpoints
2022-11-15 16:34:29 +01:00
Simon Pasquier
1199e07cca
Merge pull request #5147 from JoaoBraveCoding/5116
Implements `spec.attachMetadata.node` for ServiceMonitor
2022-11-15 14:16:24 +01:00
JoaoBraveCoding
563d9b890f
Implements spec.attachMetadata.node for ServiceMonitor
Issue: https://github.com/prometheus-operator/prometheus-operator/issues/5116

Problem: spec.attachMetadata.node had been previously implemented for
PodMonitor. With PR https://github.com/prometheus/prometheus/pull/10759
being merge it's now possible to also have this field for
ServiceMonitor

Solution: add the field to the ServiceMonitor CR and pass it to
generateK8SSDConfig instead of nil

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2022-11-15 10:36:01 +00:00
Joao Marcal
de71440aec
Adds a filter for non-running pods for ServiceMonitor (#5149)
Issue: https://github.com/prometheus-operator/prometheus-operator/issues/4877

Problem: on a previous PR the capability to drop metrics from
PodMonitors who's pods were in Failed or Succeded state was introduced.
The same can also be done for ServiceMonitors since if a Service is
backed by a Pod then all labels of the role: pod discovery are attached
as per the documetation on https://prometheus.io/docs/prometheus/latest/configuration/configuration/#endpoints

Solution: Add a step to drop metrics from pods which are in the phase Failed or
Succeeded

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>

Signed-off-by: JoaoBraveCoding <jmarcal@redhat.com>
2022-11-14 15:50:53 +00:00
Raphael Husistein
dc41cbe09f pkg/promcfg: Add support for enableHttp2 flag in AlertingEndpoints
Among others "enable_http2" <bool> (default: true) should be configurable
for AlertingEndpoints in the prometheus configuration. At the moment
there is no option to overwrite the enable_http2 flag for the default prefix /
and it is always set to true by the prometheus-operator. If istio service-mesh
is in place, alerts will not be sent to alertmanager as long as enable_http2
is set to true (see issue https://github.com/prometheus/prometheus/issues/10213).
This PR adds the support to define the enableHttp2 flag in the AlertingEndpoint.

Fixes #5146

Signed-off-by: Raphael Husistein <raphael.husistein@hotmail.com>
2022-11-11 03:04:39 +01:00
Razvan Dobre
0aa49df48f
Add filter_external_labels remote_read flag (#5142)
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-11-10 22:42:06 +01:00
Simon Pasquier
06b007cf71 Documentation: add CLI documentation to website
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-10-21 12:17:32 +02:00
Simon Pasquier
3a50451209
Merge pull request #5081 from sonali-rajput/sonali-rajput/probe-config-ignored-5036
Update ProbeTLSConfig and SafeTLSConfig description
2022-10-14 12:19:52 +02:00
Sonali Rajput
aff46233d1 ProbeTLSConfig and SafeTLSConfig description update 2022-10-13 18:04:44 +00:00
Simon Pasquier
03e5ef8939
Merge pull request #5072 from slashpai/rule_desc
pkg/apis: Update Rule/RuleGroup desc and add CRD validation
2022-10-13 15:02:20 +02:00
Jayapriya Pai
6c056516c8 pkg/apis: Update Rule/RuleGroup desc and add CRD validation
Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2022-10-13 17:44:23 +05:30
Simon Pasquier
cb5b69b2e2
pkg/apis/monitoring/v1: improve configSecret doc (#5082)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-10-12 21:00:23 +01:00
Simon Pasquier
893b5c9c0f
*: support out-of-order time window for Prometheus (#5071)
Signed-off-by: Simon Pasquier <spasquie@redhat.com>

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-10-06 09:51:08 +00:00
Pratik Raj
036e7c4437
feat : enable support for "hostNetwork" in Prometheus CRD (#5010)
Enabled support for "hostNetwork" in Prometheus Operator

Needed in many scenarios like:
1. To bypass the CNI network
2. In general to reduce the metrics traffic overhead on CNI network
in clusters with large no of Nodes.

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2022-10-05 17:01:15 +02:00
Simon Pasquier
9a7a6efb89
Documentation: add more content to online docs (#5060)
* Documentation: add more content to online docs

This change adds the following content to prometheus-operator.dev website:
* New "User Guides" section with the "Getting Started" and "Alerting" guides.
  I've updated/cleaned up the existing content to match with the current
  release of the operator.
* "Storage" and "Strategic Merge Patch" pages to the Operator section.

The "Storage" page also documents how to manually expand statefulset volumes
(related to #4079).

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

* Address Philip's comments

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

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-10-05 16:27:27 +02:00
Simon Pasquier
85d4f68aaa *: fix unescaped characters in API doc
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-30 11:20:21 +02:00
Ben Kochie
edf499e8a2
Add a filter for non-running pods (#5049)
Add a boolean option to PodMetricsEndpoint to filter out non-running
phases.
* Enable by default.

Fixes: https://github.com/prometheus-operator/prometheus-operator/issues/4816

Signed-off-by: SuperQ <superq@gmail.com>
2022-09-28 17:39:29 +01:00
Simon Pasquier
9c0a71dcfe
pkg/prometheus: add {grpc,http}ListenLocal for Thanos sidecar (#5045)
When `spec.thanos.listenLocal` is true, both gRPC and HTTP endpoints are
configured to listen on the loopback interface. It is sometimes needed
to listen on all interfaces for gRPC and on the loopback interface only
for HTTP.

This commit introduces the `spec.thanos.grpcListenLocal` and
`spec.thanos.httpListenLocal` fields to enable all possible use cases.
`spec.thanos.listenLocal` is marked as deprecated since the new fields
offer equivalent possibilities with fine-grained controls.

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

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-28 16:56:58 +01:00
Simon Pasquier
943ee2f786
*: Add ThanosRuler CRD to API reference (#5053)
This got missed (and never noticed!) since #4899

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

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-28 15:09:05 +00:00
Hans Kristian Moen
d97626312d
replace non ascii apostrophe (#5028)
* replace non ascii apostrophe

* add api doc after ascii update
2022-09-19 15:54:39 +00:00
Tomas Remes
13953bcd29
feat: add observedGeneration attribute to the status conditions (#5005)
* feat: add observedGeneration attribute to the status conditions

* update generated resources

* Update tests to check the generation

* Fix after review
2022-09-12 16:29:54 +02:00
Simon Pasquier
026d4b04c8
Update api comments (#5006)
* pkg/apis/monitoring/v1: update comments

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

* *: regenerate

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

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-12 11:28:22 +02:00
Philip Gough
a0f2d49436
Merge pull request #4996 from simonpasquier/fix-typo
pkg/apis/monitoring/v1: fix typo in comment
2022-09-06 15:31:32 +01:00
Simon Pasquier
369d9a58d5 pkg/apis/monitoring/v1: fix typo in comment
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2022-09-05 16:03:30 +02:00
jojotong
8b24f10183
feat(alertmanager): support to set templates in alertmanagerConfiguration. (#4933) 2022-09-02 16:58:50 +02:00
Jakob
fd04440c0c
Add TracingConfigFile option to ThanosRuler (#4962)
* Add TracingConfigFile option for ThanosRuler

* Generated Changes
2022-08-10 15:38:41 +02:00