Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[telegraf-ds] Add option for simple override of TOML config file contents #239

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion charts/telegraf-ds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: telegraf-ds
version: 1.0.18
version: 1.0.19
appVersion: 1.16
deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
Expand All @@ -10,6 +10,8 @@ keywords:
- timeseries
- influxdata
home: https://www.influxdata.com/time-series-platform/telegraf/
sources:
- https://github.com/influxdata/helm-charts/charts/telegraf-ds
maintainers:
- name: rawkode
email: [email protected]
Expand Down
5 changes: 5 additions & 0 deletions charts/telegraf-ds/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
labels:
{{- include "telegraf.labels" . | nindent 4 }}
data:
{{- if .Values.override_config.toml }}
telegraf.conf: |+
{{- .Values.override_config.toml | nindent 4 }}
{{- else }}
telegraf.conf: |+
{{ template "global_tags" .Values.config.global_tags }}
{{ template "agent" .Values.config.agent }}
Expand Down Expand Up @@ -37,3 +41,4 @@ data:
url = "https://$HOSTIP:10250"
bearer_token = "/run/secrets/kubernetes.io/serviceaccount/token"
insecure_skip_verify = true
{{- end }}
15 changes: 15 additions & 0 deletions charts/telegraf-ds/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ serviceAccount:
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
# priorityClassName: system-node-critical

override_config:
toml: ~
# Provide a literal TOML config
# toml: |+
# [global_tags]
# foo = "bar"
# [agent]
# interval = "10s"
# [[inputs.mem]]
# [[outputs.influxdb_v2]]
# urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"]
# bucket = "data"
# organization = "OurCompany"
# token = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

## Exposed telegraf configuration
## ref: https://docs.influxdata.com/telegraf/v1.13/administration/configuration/
config:
Expand Down