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 Alertmanager controller #201

Merged
merged 74 commits into from
Dec 16, 2024
Merged

Add Alertmanager controller #201

merged 74 commits into from
Dec 16, 2024

Conversation

TheoBrigitte
Copy link
Member

@TheoBrigitte TheoBrigitte commented Dec 15, 2024

Towards: giantswarm/roadmap#3747

This PR adds the Alertmanager controller, which reconciles the Alertmanager secret created by the observability-operator Helm chart and load the configuration and templates from the secret into Mimir Alertmanager.
It also watches the Mimir Alertmanager pod and re-queue events to the controller when the pod is restarted, so the configuration is reloaded.

  • Predicates are being used to filter the secret and pods being watched to only act on Alertmanager related resources.
  • Finalizers are not used by this controller as the configuration is never deleted, only updated.

TheoBrigitte and others added 30 commits December 5, 2024 19:34
- Add secret resource, embedding raw and templated alertmanager files
- Expose alertmanager templates values as helm chart values
- Remove all Mimir related conditions
- Split template into url and notification templates
- Drop template directive, dynamically set by the operator
- Escape template in template
- Re-use slack actions
This fixes the infamous: error calling tpl: cannot retrieve Template.Basepath from values inside tpl function

It does use .Values in templates to access values and pass $ root context to tpl
Co-authored-by: Quentin Bisson <[email protected]>
@TheoBrigitte
Copy link
Member Author

Tested all 3 cases, when reconciliation should happen

  • operator boot up
  • mimir-alertmanager becomes ready
  • alertmanager secret is updated

main.go Show resolved Hide resolved
main.go Show resolved Hide resolved
@@ -31,12 +31,15 @@ spec:
- --management-cluster-pipeline={{ $.Values.managementCluster.pipeline }}
- --management-cluster-region={{ $.Values.managementCluster.region }}
# Monitoring configuration
- --alertmanager-enabled={{ $.Values.alerting.enabled }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this under #alerting configuration but this can be done once all PRs are merged

Copy link
Member Author

Choose a reason for hiding this comment

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

That's already under alerting

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant the comment 😉

Base automatically changed from alertmanager-config to main December 16, 2024 15:03
@TheoBrigitte TheoBrigitte merged commit b16ca41 into main Dec 16, 2024
10 checks passed
@TheoBrigitte TheoBrigitte deleted the alertmanager-controller branch December 16, 2024 17:24
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.

4 participants