Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

telegraf: Allow passing ENV variables to pod #108

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions telegraf-ds/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ spec:
value: "/rootfs/proc"
- name: "HOST_SYS"
value: "/rootfs/sys"
{{- if .Values.env }}
{{- .Values.env | toYaml | trimSuffix "\n" | nindent 8 }}
{{- end }}
volumeMounts:
- name: varrunutmpro
mountPath: /var/run/utmp
Expand Down
6 changes: 6 additions & 0 deletions telegraf-ds/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ resources:
##
tolerations: []

## Telegraf accepts environment variables in its configuration
## ref: https://docs.influxdata.com/telegraf/latest/administration/configuration/#environment-variables
env: {}
# - name: INFLUXDB_DB
# value: "demo"

## Exposed telegraf configuration
## ref: https://docs.influxdata.com/telegraf/v1.8/administration/configuration/
config:
Expand Down
4 changes: 4 additions & 0 deletions telegraf-s/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ spec:
imagePullPolicy: {{ default "" .Values.image.pullPolicy | quote }}
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.env }}
env:
{{- .Values.env | toYaml | trimSuffix "\n" | nindent 8 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/telegraf
Expand Down
6 changes: 6 additions & 0 deletions telegraf-s/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ nodeSelector: {}
##
tolerations: []

## Telegraf accepts environment variables in its configuration
## ref: https://docs.influxdata.com/telegraf/latest/administration/configuration/#environment-variables
env: {}
# - name: INFLUXDB_DB
# value: "demo"

## Affinity for pod assignment
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
##
Expand Down