|
| 1 | +{{- /* |
| 2 | + Reject an empty tracingStorages outright, mirroring the logsStorages guard |
| 3 | + (issue #3181). With no entry no VTCluster/VTSingle is rendered, the |
| 4 | + monitoring-system HelmRelease readiness gate (which keys on the traces CR) has |
| 5 | + nothing to match, and OTLP producers ship spans to a backend that never |
| 6 | + exists — silently dropping traces. Fail the render instead so the |
| 7 | + misconfiguration is loud, not silent. |
| 8 | +*/ -}} |
| 9 | +{{- if not .Values.tracingStorages }} |
| 10 | +{{- fail "monitoring: tracingStorages must define at least one entry; an empty list renders no VictoriaTraces backend and OTLP producers silently drop spans" }} |
| 11 | +{{- end }} |
| 12 | +{{- range .Values.tracingStorages }} |
| 13 | +--- |
| 14 | +{{- if eq (.mode | default "cluster") "single" }} |
| 15 | +apiVersion: operator.victoriametrics.com/v1 |
| 16 | +kind: VTSingle |
| 17 | +metadata: |
| 18 | + name: {{ .name }} |
| 19 | +spec: |
| 20 | + managedMetadata: |
| 21 | + labels: |
| 22 | + apps.cozystack.io/application.group: apps.cozystack.io |
| 23 | + apps.cozystack.io/application.kind: Monitoring |
| 24 | + apps.cozystack.io/application.name: {{ $.Release.Name }} |
| 25 | + retentionPeriod: {{ .retentionPeriod | quote }} |
| 26 | + {{- with .retentionDiskUsageBytes }} |
| 27 | + retentionMaxDiskSpaceUsageBytes: {{ . | quote }} |
| 28 | + {{- end }} |
| 29 | + # Stamped on the storage PVC so the monitoring post-delete cleanup hook can |
| 30 | + # select it by this label (same release-scoped cleanup as logs/metrics). |
| 31 | + storageMetadata: |
| 32 | + labels: |
| 33 | + apps.cozystack.io/application.name: {{ $.Release.Name }} |
| 34 | + storage: |
| 35 | + {{- with .storageClassName }} |
| 36 | + storageClassName: {{ . }} |
| 37 | + {{- end }} |
| 38 | + accessModes: |
| 39 | + - ReadWriteOnce |
| 40 | + resources: |
| 41 | + requests: |
| 42 | + storage: {{ .storage }} |
| 43 | +{{- else }} |
| 44 | +apiVersion: operator.victoriametrics.com/v1 |
| 45 | +kind: VTCluster |
| 46 | +metadata: |
| 47 | + name: {{ .name }} |
| 48 | +spec: |
| 49 | + managedMetadata: |
| 50 | + labels: |
| 51 | + apps.cozystack.io/application.group: apps.cozystack.io |
| 52 | + apps.cozystack.io/application.kind: Monitoring |
| 53 | + apps.cozystack.io/application.name: {{ $.Release.Name }} |
| 54 | + insert: |
| 55 | + replicaCount: 2 |
| 56 | + resources: {} |
| 57 | + select: |
| 58 | + replicaCount: 2 |
| 59 | + resources: {} |
| 60 | + storage: |
| 61 | + retentionPeriod: {{ .retentionPeriod | quote }} |
| 62 | + {{- with .retentionDiskUsageBytes }} |
| 63 | + retentionMaxDiskSpaceUsageBytes: {{ . | quote }} |
| 64 | + {{- end }} |
| 65 | + replicaCount: 2 |
| 66 | + resources: {} |
| 67 | + storage: |
| 68 | + volumeClaimTemplate: |
| 69 | + metadata: |
| 70 | + # Stamped on the claim template so vm-operator copies it onto the |
| 71 | + # storage PVCs; managedMetadata is not applied to PVCs. The monitoring |
| 72 | + # post-delete cleanup hook selects PVCs by this label to stay |
| 73 | + # release-scoped (mirrors vlogs/vmcluster). |
| 74 | + labels: |
| 75 | + apps.cozystack.io/application.name: {{ $.Release.Name }} |
| 76 | + spec: |
| 77 | + {{- with .storageClassName }} |
| 78 | + storageClassName: {{ . }} |
| 79 | + {{- end }} |
| 80 | + resources: |
| 81 | + requests: |
| 82 | + storage: {{ .storage }} |
| 83 | +{{- end }} |
| 84 | +{{- end }} |
0 commit comments