From f993790a317d44b583160942f7c2311b3e14b704 Mon Sep 17 00:00:00 2001 From: Franklin Ty Date: Tue, 20 Aug 2024 15:07:50 -0500 Subject: [PATCH] [telegraf] Support configurable Deployment labels/annotations 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. --- charts/telegraf/Chart.yaml | 2 +- charts/telegraf/templates/deployment.yaml | 7 +++++++ charts/telegraf/values.yaml | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/charts/telegraf/Chart.yaml b/charts/telegraf/Chart.yaml index 4615bb89..d3c3e7d8 100755 --- a/charts/telegraf/Chart.yaml +++ b/charts/telegraf/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: telegraf -version: 1.8.53 +version: 1.8.54 appVersion: 1.31.3 deprecated: false description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. diff --git a/charts/telegraf/templates/deployment.yaml b/charts/telegraf/templates/deployment.yaml index 81a046a7..e05b36c2 100644 --- a/charts/telegraf/templates/deployment.yaml +++ b/charts/telegraf/templates/deployment.yaml @@ -4,6 +4,13 @@ metadata: name: {{ include "telegraf.fullname" . }} labels: {{- include "telegraf.labels" . | nindent 4 }} + {{- if .Values.deploymentLabels }} +{{ toYaml .Values.deploymentLabels | indent 4 }} + {{- end }} + {{- if .Values.deploymentAnnotations }} + annotations: +{{ toYaml .Values.deploymentAnnotations | indent 4 }} + {{- end }} spec: replicas: {{ .Values.replicaCount }} selector: diff --git a/charts/telegraf/values.yaml b/charts/telegraf/values.yaml index 0324738f..a18d23d3 100644 --- a/charts/telegraf/values.yaml +++ b/charts/telegraf/values.yaml @@ -7,8 +7,15 @@ image: repo: "docker.io/library/telegraf" tag: "1.31-alpine" pullPolicy: IfNotPresent + +# Annotations/Labels to be added to Telegraf Pods podAnnotations: {} podLabels: {} + +# Annotations/Labels to be added to Telegraf Deployments +deploymentAnnotations: {} +deploymentLabels: {} + imagePullSecrets: [] ## Configure args passed to Telegraf containers args: []