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

config-reloader: add init-config-reloader to alertmanager #5358

Merged

Conversation

r3nic1e
Copy link
Contributor

@r3nic1e r3nic1e commented Feb 20, 2023

Description

This PR reuses the same approach used for prometheus statefulset that adds init-config-reloader initContainer to alertmanager statefulset - #3955.
Effectively init-config-reloader will pregenerate the alertmanager config so alertmanager won't fail due to missing config.

Fixes #5357

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

- Generate Alertmanager config before starting Alertmanager container

this ensures there is no race between alertmanager and config-reloader
generating config during initial launch

Fixes prometheus-operator#5357
@r3nic1e r3nic1e requested a review from a team as a code owner February 20, 2023 21:08
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks!

operator.LogLevel(a.Spec.LogLevel),
operator.WatchedDirectories(watchedDirectories),
operator.VolumeMounts(configReloaderVolumeMounts),
operator.Shard(-1),
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't needed for Alertmanager but I see that you've copied it from the existing reloader config container so it can be cleaned up in a following PR as well.

Suggested change
operator.Shard(-1),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, thought about that. Just wanted to keep as close to the sidecar reloader config as possible

@simonpasquier simonpasquier merged commit 0c583ad into prometheus-operator:main Feb 21, 2023
@r3nic1e r3nic1e deleted the alertmanager-init-config branch February 21, 2023 10:56
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.

Add init-config-reloader to alertmanager
2 participants