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] fix docker plugin #21

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 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.31
version: 1.0.32
appVersion: 1.21.4
deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
Expand Down
1 change: 1 addition & 0 deletions charts/telegraf-ds/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Default values only, no overrides
2 changes: 2 additions & 0 deletions charts/telegraf-ds/ci/docker-no-endpoint-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config:
docker_endpoint: ""
4 changes: 3 additions & 1 deletion charts/telegraf-ds/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ data:
[[inputs.disk]]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

{{- if .Values.config.docker_endpoint }}
[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
endpoint = {{ .Values.config.docker_endpoint | quote }}
{{- end }}

[[inputs.kubernetes]]
url = "https://$HOSTIP:10250"
Expand Down
9 changes: 7 additions & 2 deletions charts/telegraf-ds/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ spec:
- name: hostfsro
mountPath: /hostfs
readOnly: true
{{- if hasPrefix "unix" .Values.config.docker_endpoint }}
- name: docker-socket
mountPath: /var/run/docker.sock
mountPath: {{ trimPrefix "unix://" .Values.config.docker_endpoint }}
{{- end }}
- name: config
mountPath: /etc/telegraf
{{- with .Values.nodeSelector }}
Expand All @@ -66,9 +68,12 @@ spec:
- name: hostfsro
hostPath:
path: /
{{- if hasPrefix "unix" .Values.config.docker_endpoint }}
- name: docker-socket
hostPath:
path: /var/run/docker.sock
path: {{ trimPrefix "unix://" .Values.config.docker_endpoint }}
type: Socket
{{- end }}
- name: varrunutmpro
hostPath:
path: /var/run/utmp
Expand Down
1 change: 1 addition & 0 deletions charts/telegraf-ds/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ config:
user_agent: "telegraf"
insecure_skip_verify: false
monitor_self: false
docker_endpoint: "unix:///var/run/docker.sock"