Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GEP-19] Migrate aggregate Prometheus deployment and configuration #9200

Merged
merged 16 commits into from
Feb 28, 2024

Conversation

rfranzke
Copy link
Member

How to categorize this PR?

/area dev-productivity monitoring
/kind enhancement

What this PR does / why we need it:
Similar to #9128 and #9180, this PR migrates management of the aggregate Prometheus deployment and its configuration to prometheus-operator.

The learnings/follow-ups from #9189 and #9195 are already incorporated.

Which issue(s) this PR fixes:
Part of #9065

Special notes for your reviewer:
/cc @oliver-goetz @ScheererJ
FYI @istvanballok @rickardsjp

Release note:

It is now possible to provide configuration for the aggregate Prometheus running in seed clusters' `garden` namespaces. Read all about it [here](https://github.com/gardener/gardener/tree/master/docs/extensions/logging-and-monitoring.md#aggregate-prometheus).

@gardener-prow gardener-prow bot added area/dev-productivity Developer productivity related (how to improve development) area/monitoring Monitoring (including availability monitoring and alerting) related kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Feb 21, 2024
@gardener-prow gardener-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 21, 2024
@gardener-prow gardener-prow bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 22, 2024
@gardener-prow gardener-prow bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 22, 2024
The `metering.rules.stateful.yaml` file is exactly the same as used in the cache Prometheus. There is a bash script generating it (https://github.com/gardener/gardener/blob/master/pkg/component/monitoring/prometheus/cache/assets/prometheusrules/metering.rules.stateful.sh). Let's simply copy it from there and reuse it.
We use a `ScrapeConfig` resource here because we explicitly want to have the `role=service` in the `kubernetes_sd_configs`
We already follow this approach for optimizing the transitive imports for other components, see
- pkg/component/coredns/constants
- pkg/component/etcd/constants
- pkg/component/kubeapiserver/constants
- pkg/component/nodelocaldns/constants
- pkg/component/resourcemanager/constants
- pkg/component/vpa/constants

Without this, we would introduce some undesired transitive package imports, requiring to update the skaffold config:

```
>> Checking defined dependencies in Skaffold config 'provider-local' for 'gardener-extension-provider-local' in 'skaffold.yaml'...
>>> The following actual dependencies are missing (need to be added):
pkg/component/etcd
pkg/component/etcd/constants
pkg/component/monitoring
pkg/component/monitoring/alertmanager
pkg/component/monitoring/prometheus
pkg/component/monitoring/prometheus/cache

>>> The following dependencies are not needed actually (need to be removed):

>>> Run './hack/update-skaffold-deps.sh' to fix.

>> Checking defined dependencies in Skaffold config 'gardenlet' for 'gardener-node-agent' in 'skaffold.yaml'...
>>> The following actual dependencies are missing (need to be added):
pkg/component/etcd
pkg/component/etcd/constants
pkg/component/monitoring
pkg/component/monitoring/alertmanager
pkg/component/monitoring/prometheus
pkg/component/monitoring/prometheus/cache
pkg/extensions
pkg/utils/kubernetes/unstructured

>> Checking defined dependencies in Skaffold config 'gardener-operator' for 'gardener-operator' in 'skaffold-operator.yaml'...
>>> The following actual dependencies are missing (need to be added):
pkg/component/monitoring
pkg/component/monitoring/alertmanager
pkg/component/monitoring/prometheus

>>> The following dependencies are not needed actually (need to be removed):

>>> Run './hack/update-skaffold-deps.sh' to fix.
```

This approach actually allows us to drop some package dependencies.
@ScheererJ
Copy link
Contributor

/assign

Copy link
Contributor

@ScheererJ ScheererJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the awesome pull request. I have a few questions/comments.

docs/extensions/logging-and-monitoring.md Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/seed/components.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/seed/components.go Outdated Show resolved Hide resolved
pkg/gardenlet/controller/seed/seed/components.go Outdated Show resolved Hide resolved
pkg/component/istio/monitoring.go Show resolved Hide resolved
pkg/component/istio/monitoring.go Show resolved Hide resolved
Copy link
Contributor

@ScheererJ ScheererJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 23, 2024
Copy link
Contributor

gardener-prow bot commented Feb 23, 2024

LGTM label has been added.

Git tree hash: 53303ded216535207b1afe4f3fa29b429f9e473f

@rfranzke
Copy link
Member Author

/approve

Copy link
Contributor

gardener-prow bot commented Feb 28, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rfranzke

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 28, 2024
@gardener-prow gardener-prow bot merged commit 2416f88 into gardener:master Feb 28, 2024
17 checks passed
@rfranzke rfranzke deleted the gep19/aggregate-prometheus branch February 28, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/dev-productivity Developer productivity related (how to improve development) area/monitoring Monitoring (including availability monitoring and alerting) related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants