* 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>
* 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>
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>
* 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>
* 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>
* 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>
* 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>
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>
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>
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>
* 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>
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>
This got missed (and never noticed!) since #4899
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* feat: add observedGeneration attribute to the status conditions
* update generated resources
* Update tests to check the generation
* Fix after review