Skip to content

Commit

Permalink
[telegraf-ds] Add option for simple override of TOML config file cont…
Browse files Browse the repository at this point in the history
…ents (#239)

* Add support for overriding entire TOML config as an escape valve

* Update version number
  • Loading branch information
philomory authored Nov 26, 2020
1 parent f302281 commit b1765d0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
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

1 comment on commit b1765d0

@jmorcar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it means toml configuration feature? If you have a values.yaml wit basic config with outputs and after a toml configuration with new inputs plugins .. Would it be possible both configurations ?

Please sign in to comment.