VictoriaMetrics / helm-charts

Helm charts for VictoriaMetrics, VictoriaLogs and ecosystem
https://victoriametrics.github.io/helm-charts/
Apache License 2.0
349 stars 332 forks source link

how to specifiy "-promscrape.cluster.memberNum" in vmagent helm chart when multiple replicas are configured #298

Closed venkatbvc closed 2 months ago

venkatbvc commented 2 years ago

In VmAgent chart:

Currently k8s doesn't support providing statefulset ordinal index to the pod. A wrapper script needs to be added before starting vmagent. This will not work if distroless images are used.

Will it be better to take hostname and get the ordinal number in k8s environments?

Haleygo commented 1 year ago

Hello! Maybe you can use vmagent cr in victoria-metrics-k8s-stack, operator will help build this parameter.

AndrewChubatiuk commented 2 months ago

VictoriaMetrics already supports extraction of -promscrape.cluster.memberNum from pod name for statefulsets and it's already implemented in victoria-metrics-agent helm chart with

statefulset:
  enabled: true
  clusterMode: true