Commit 8132f658 authored by Wojtek Siudzinski's avatar Wojtek Siudzinski Committed by David McKay

Add lifecycle hooks to Telegraf

parent 164ae46d
...@@ -39,6 +39,25 @@ spec: ...@@ -39,6 +39,25 @@ spec:
- name: {{ .name }} - name: {{ .name }}
mountPath: {{ .mountPath }} mountPath: {{ .mountPath }}
{{- end }} {{- end }}
{{- if .Values.hooks }}
lifecycle:
{{- if .Values.hooks.postStart }}
postStart:
exec:
command:
{{- range .Values.hooks.postStart }}
- {{ . | quote }}
{{- end }}
{{ end }}
{{- if .Values.hooks.preStop }}
preStop:
exec:
command:
{{- range .Values.hooks.preStop }}
- {{ . | quote }}
{{- end }}
{{ end }}
{{ end }}
{{- range $objectKey, $objectValue := .Values.config.outputs }} {{- range $objectKey, $objectValue := .Values.config.outputs }}
{{- range $key, $value := . -}} {{- range $key, $value := . -}}
{{- $tp := typeOf $value -}} {{- $tp := typeOf $value -}}
......
...@@ -124,3 +124,8 @@ config: ...@@ -124,3 +124,8 @@ config:
metric_separator: "_" metric_separator: "_"
allowed_pending_messages: 10000 allowed_pending_messages: 10000
percentile_limit: 1000 percentile_limit: 1000
# Lifecycle hooks
# hooks:
# postStart: ["/bin/sh", "-c", "echo Telegraf started"]
# preStop: ["/bin/sh", "-c", "sleep 60"]
\ No newline at end of file
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