cozystack/packages/system/monitoring/templates/vm/vmagent.yaml
2026-03-18 19:07:33 +01:00

37 lines
1.1 KiB
YAML

{{- if and (ne .Release.Namespace "tenant-root") (ne .Release.Namespace "cozy-monitoring") }}
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
name: vmagent
spec:
podMetadata:
labels:
policy.cozystack.io/allow-to-apiserver: "true"
shardCount: 1
externalLabels:
cluster: {{ .Values.vmagent.externalLabels.cluster }}
tenant: {{ .Release.Namespace }}
{{- if .Values.vmagent.externalLabels.environment }}
environment: {{ .Values.vmagent.externalLabels.environment | quote }}
{{- end }}
extraArgs:
promscrape.maxScrapeSize: "32MB"
promscrape.streamParse: "true"
remoteWrite:
{{- range .Values.vmagent.remoteWrite.urls }}
- url: {{ . | quote }}
{{- end }}
scrapeInterval: 30s
selectAllByDefault: false
{{- with .Values.vmagent.inlineScrapeConfig }}
inlineScrapeConfig: |
{{- . | nindent 4 }}
{{- end }}
podScrapeNamespaceSelector:
matchLabels:
namespace.cozystack.io/monitoring: {{ .Release.Namespace }}
serviceScrapeNamespaceSelector:
matchLabels:
namespace.cozystack.io/monitoring: {{ .Release.Namespace }}
{{- end }}