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

Add support to disable monitoring at the installation or cluster level #48

Merged
merged 9 commits into from
Jul 16, 2024

Conversation

QuentinBisson
Copy link
Contributor

@QuentinBisson QuentinBisson commented Jul 9, 2024

What this PR does / why we need it

Allow support to disable prometheus agents and the monitoring stack when monitoring is disabled at the installation or cluster level giantswarm/roadmap#3513

This cannot be released as long as we do not have mimir everywhere (cf. giantswarm/roadmap#3335) but I would love your reviews

Checklist

  • Update changelog in CHANGELOG.md.

@QuentinBisson QuentinBisson self-assigned this Jul 9, 2024
@QuentinBisson QuentinBisson requested a review from a team as a code owner July 9, 2024 14:46
@QuentinBisson QuentinBisson force-pushed the add-support-to-disable-monitoring branch 7 times, most recently from 404b28f to f5155cc Compare July 9, 2024 20:04
@QuentinBisson QuentinBisson force-pushed the add-support-to-disable-monitoring branch from f5155cc to e53ed84 Compare July 9, 2024 21:01
@QuentinBisson
Copy link
Contributor Author

@giantswarm/team-atlas This has been tested on Grizzly

CHANGELOG.md Outdated Show resolved Hide resolved
@@ -78,3 +81,8 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)

replace (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix a nancy issue because opsgenie sdk is quite old

Signed-off-by: QuentinBisson <[email protected]>
@QuentinBisson QuentinBisson force-pushed the add-support-to-disable-monitoring branch from dbc22b3 to a9d0b79 Compare July 9, 2024 21:15
@@ -88,23 +91,27 @@ func (r *ClusterMonitoringReconciler) Reconcile(ctx context.Context, req ctrl.Re
ctx = log.IntoContext(ctx, logger)

if !r.MonitoringConfig.Enabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need this condition since you add if !r.MonitoringConfig.IsMonitored(cluster) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes because we need to create/delete things if the installation is monitored (mimir secrets for instance) and some we need to do for all clusters

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but this is an info log only. The issue is that thé mc cluster Can have thé giantswarm.io/monitoring: false but not the installation

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd have preferred adding the log in the IsMonitored function and keep only one condition in the controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I don't want the code to log everytime I use this condition :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And as mentionned, we cannot keep only 1 condition because we create MC level resources (like the mimir ingress) and resources for each WCs and they do not depend on the same value

internal/controller/cluster_monitoring_controller.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
@QuentinBisson QuentinBisson merged commit 27df917 into main Jul 16, 2024
6 checks passed
@QuentinBisson QuentinBisson deleted the add-support-to-disable-monitoring branch July 16, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants