-
Notifications
You must be signed in to change notification settings - Fork 145
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
Operator duplicates values from VMAlertManagerConfig to config secret #954
Comments
Hello, thanks for reporting! Issue related to the name clash of configSecret and secret created by operator itself. Operator builds the following name for own secret: an example of config with bug: apiVersion: v1
kind: Secret
metadata:
name: vmalertmanager-example-config
labels:
app: vm-operator
type: Opaque
stringData:
alertmanager.yaml: |
global:
resolve_timeout: 5m
route:
receiver: 'blachole'
receivers:
- name: 'blachole'
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAlertmanager
metadata:
name: example
spec:
replicaCount: 1
configSecret: vmalertmanager-example-config
selectAllByDefault: true I think, proper fix for it is ignoring any content of secret, if it's name matches the name of secret created by operator. Will be fixed at the next patch release |
…efault Ignores any content from secret define at cr.spec.configSecret, if it name clashes with name of the secret created by operator. #954
…efault Ignores any content from secret define at cr.spec.configSecret, if it name clashes with name of the secret created by operator. #954
Thank you for fast response! One more detail: I set |
You have to set value of Thanks for the test case, added it to the PR. |
Changes was included to v0.45.0 release. |
Hello!
I found a problem with updating Secret with VM Alert Manager config.
I deployed the last release version v0.44.0 for this moment.
For example, if I create VMAlertManagerConfig like this:
Victoria Metrics operator watches for
test-amc
, updates secret with name set in VMAlertManager (spec.configSecret) and makes it every reconcile cycle.After updating the secret I see duplicated values (receivers, inhibit_rules and route.routes) in secret data
alertmanager.yaml
:Seems like rootcause is in function
buildConfig
https://github.com/VictoriaMetrics/operator/blob/v0.44.0/controllers/factory/alertmanager/config.go#L55. There is no check for duplicates in existing receivers, inhibit rules and subroutes.Finally, I see error logs in vmalertmanager:
and in the operator after some time (several hours), because secret has too many duplicated values:
I created a test to check the behavior locally. The problem reproduces again.
alertmanager_test.zip
Could you please investigate and fix the problem?
The text was updated successfully, but these errors were encountered: