charts icon indicating copy to clipboard operation
charts copied to clipboard

[chart/grafana-agent][REQUEST] support hashmod with Statefulset

Open KimMJ opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like

  1. Add following values. Default should be hostname mode.
scrapingServiceMode:
  enabled: false

hashmod:
  enabled: false

hostname:
  enabled: true
  1. Add Statefulset Manifest
  2. Add PODNAME environment
            - name: PODNAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
  1. Add hashmod configuration in agent configs
            - action: hashmod
              source_labels: [__address__]
              modulus: {{ .Values.replicaCount }}
              target_label: __tmp_hashmod
            - action: keep
              source_labels: [__tmp_hashmod]
              regex: ^${PODNAME##*-}$ # to get index from pod name

Additional context This is for some environments that cannot use Grafana Operator but want to use hashmod. Should write how to configure hashmod in README file

Please let me know your opinion or better idea. I already customized it from our environment so it will be easy to add PR for me.

KimMJ avatar May 10 '22 10:05 KimMJ