influxdata / helm-charts

Official Helm Chart Repository for InfluxData Applications
MIT License
233 stars 330 forks source link

[telegraf] Support configurable Deployment labels/annotations #667

Open lovetoburnswhen opened 3 months ago

lovetoburnswhen commented 3 months ago

Adds the deploymentAnnotations/deploymentLabels properties to values.yaml to allow users to specify custom labels and annotations on the Deployments.

This feature would be tremendously useful for environments that require certain labels to be set - the only alternative would be to fork the chart internally.


Tested with:

❯ helm template ./charts/telegraf -s templates/deployment.yaml --set 'deploymentLabels.foo=bar' --set 'deploymentAnnotations.bar=baz'  
---
# Source: telegraf/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: release-name-telegraf
  labels:
    helm.sh/chart: telegraf-1.8.54
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: telegraf
    app.kubernetes.io/instance: release-name
    foo: bar
  annotations:
    bar: baz
spec:
...

bqbn commented 1 month ago

This is a useful feature. One use case is allowing the PodMonitoring resource to have finer granularity in selecting which Telegraf pods to scrape metrics from.

Please consider merging this PR at your earliest convenience.