[monitoring] Add lineage labels to VM components

Since the VictoriaMetrics operator aggressively manages the metadata on
all owned components, the addition of labels by the lineage webhook
causes non-stop updates sent to the k8s API server. We mitigate this by
modifying the Monitoring Helm chart to set the `managedMetadata` field
on all VictoriaMetrics custom resources, where applicable.

```release-note
[monitoring] Explicitly set lineage labels on VictoriaMetrics' resources
known not to play nice when something modifies their owned resources in
flight.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin
2025-09-25 10:53:31 +03:00
parent 23e59ea654
commit 21ca1349c4
4 changed files with 20 additions and 0 deletions

View File

@@ -232,6 +232,11 @@ kind: VMAlertmanager
metadata:
name: alertmanager
spec:
managedMetadata:
labels:
apps.cozystack.io/application.group: apps.cozystack.io
apps.cozystack.io/application.kind: Monitoring
apps.cozystack.io/application.name: {{ $.Release.Name }}
replicaCount: 3
configSecret: alertmanager
podMetadata:

View File

@@ -4,6 +4,11 @@ kind: VLogs
metadata:
name: {{ .name }}
spec:
managedMetadata:
labels:
apps.cozystack.io/application.group: apps.cozystack.io
apps.cozystack.io/application.kind: Monitoring
apps.cozystack.io/application.name: {{ $.Release.Name }}
image:
tag: v1.17.0-victorialogs
storage:

View File

@@ -5,6 +5,11 @@ kind: VMAlert
metadata:
name: vmalert-{{ .name }}
spec:
managedMetadata:
labels:
apps.cozystack.io/application.group: apps.cozystack.io
apps.cozystack.io/application.kind: Monitoring
apps.cozystack.io/application.name: {{ $.Release.Name }}
datasource:
url: http://vmselect-{{ .name }}.{{ $.Release.Namespace }}.svc:8481/select/0/prometheus
evaluationInterval: 15s

View File

@@ -5,6 +5,11 @@ kind: VMCluster
metadata:
name: {{ .name }}
spec:
managedMetadata:
labels:
apps.cozystack.io/application.group: apps.cozystack.io
apps.cozystack.io/application.kind: Monitoring
apps.cozystack.io/application.name: {{ $.Release.Name }}
replicationFactor: 2
retentionPeriod: {{ .retentionPeriod | quote }}
vminsert: