Unverified Commit 538ef96d authored by Angelo Fausti's avatar Angelo Fausti Committed by GitHub

Fix telegraf-ds mounts (#348)

* Mount the host filesystem inside the container - Remove the /rootfs/proc and /rootfs/sys mounts - Mount the host filesystem on /hostfs * Set HOST_PROC, HOST_SYS and HOST_MOUNT_PREFIX vars - Set HOST_PROC and HOST_SYS to the new location - Set HOST_MOUNT_PREFIX so that /hostfs is stripped from the reported path * Bump telegraf-ds chart version to 1.0.23 * Fix lint issues
parent 43bcba53
apiVersion: v1
name: telegraf-ds
version: 1.0.23
version: 1.0.24
appVersion: 1.20.2
deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
......
......@@ -43,11 +43,8 @@ spec:
- name: varrunutmpro
mountPath: /var/run/utmp
readOnly: true
- name: sysro
mountPath: /rootfs/sys
readOnly: true
- name: procro
mountPath: /rootfs/proc
- name: hostfsro
mountPath: /hostfs
readOnly: true
- name: docker-socket
mountPath: /var/run/docker.sock
......@@ -66,15 +63,12 @@ spec:
{{ toYaml . | indent 8 }}
{{- end }}
volumes:
- name: sysro
- name: hostfsro
hostPath:
path: /sys
path: /
- name: docker-socket
hostPath:
path: /var/run/docker.sock
- name: procro
hostPath:
path: /proc
- name: varrunutmpro
hostPath:
path: /var/run/utmp
......
......@@ -3,7 +3,7 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: influx:stats:viewer
name: influx-stats-viewer
labels:
{{- include "telegraf.labels" . | nindent 4 }}
rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
......
......@@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: influx:telegraf:viewer
name: influx-telegraf-viewer
labels:
{{- include "telegraf.labels" . | nindent 4 }}
subjects:
......
......@@ -33,10 +33,16 @@ env:
valueFrom:
fieldRef:
fieldPath: status.hostIP
# Mount the host filesystem and set the appropriate env variables.
# ref: https://github.com/influxdata/telegraf/blob/master/docs/FAQ.md
# HOST_PROC is required by the cpu, disk, diskio, kernel and processes input plugins
- name: "HOST_PROC"
value: "/rootfs/proc"
value: "/hostfs/proc"
# HOST_SYS is required by the diskio plugin
- name: "HOST_SYS"
value: "/rootfs/sys"
value: "/hostfs/sys"
- name: "HOST_MOUNT_PREFIX"
value: "/hostfs"
## Tolerations for pod assignment
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
......
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