Unverified Commit bae0041c authored by alespour's avatar alespour Committed by GitHub

[telegraf-ds] add pod labels, annotations and env from secret support (#461)

parent 5fb994f0
apiVersion: v1 apiVersion: v1
name: telegraf-ds name: telegraf-ds
version: 1.0.34 version: 1.1.0
appVersion: 1.22.0 appVersion: 1.22.1
deprecated: false deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics. description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
keywords: keywords:
......
...@@ -14,10 +14,16 @@ spec: ...@@ -14,10 +14,16 @@ spec:
labels: labels:
app.kubernetes.io/name: {{ include "telegraf.name" . }} app.kubernetes.io/name: {{ include "telegraf.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.podLabels }}
{{ toYaml . | indent 8 }}
{{- end }}
annotations: annotations:
# Include a hash of the configmap in the pod template # Include a hash of the configmap in the pod template
# This means that if the configmap changes, the deployment will be rolled # This means that if the configmap changes, the deployment will be rolled
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations | indent 8 }}
{{- end }}
spec: spec:
serviceAccountName: {{ template "telegraf.serviceAccountName" . }} serviceAccountName: {{ template "telegraf.serviceAccountName" . }}
{{- if .Values.priorityClassName }} {{- if .Values.priorityClassName }}
...@@ -39,6 +45,11 @@ spec: ...@@ -39,6 +45,11 @@ spec:
fieldRef: fieldRef:
fieldPath: status.hostIP fieldPath: status.hostIP
{{ toYaml .Values.env | indent 8 }} {{ toYaml .Values.env | indent 8 }}
{{- if .Values.envFromSecret }}
envFrom:
- secretRef:
name: {{ .Values.envFromSecret }}
{{- end }}
volumeMounts: volumeMounts:
- name: varrunutmpro - name: varrunutmpro
mountPath: /var/run/utmp mountPath: /var/run/utmp
......
...@@ -17,9 +17,21 @@ resources: ...@@ -17,9 +17,21 @@ resources:
memory: 2Gi memory: 2Gi
cpu: 1 cpu: 1
## Pod annotations
podAnnotations: {}
## Pod labels
podLabels: {}
## Configure args passed to Telegraf containers ## Configure args passed to Telegraf containers
args: [] args: []
## The name of a secret in the same kubernetes namespace which contains values to
## be added to the environment (must be manually created)
## This can be useful for auth tokens, etc.
# envFromSecret: "telegraf-tokens"
## Environment
env: env:
# This pulls HOSTNAME from the node, not the pod. # This pulls HOSTNAME from the node, not the pod.
- name: HOSTNAME - name: HOSTNAME
...@@ -44,7 +56,7 @@ env: ...@@ -44,7 +56,7 @@ env:
- name: "HOST_MOUNT_PREFIX" - name: "HOST_MOUNT_PREFIX"
value: "/hostfs" value: "/hostfs"
## Add custom volumes and mountPoints ## Add custom volumes and mounts
# volumes: # volumes:
# - name: telegraf-output-influxdb2 # - name: telegraf-output-influxdb2
# configMap: # configMap:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment