Skip to content

Commit c9cdece

Browse files
author
Jonathan Chauncey
committed
chore(manifest): Add entries for volume mounting procfs
1 parent 6baee25 commit c9cdece

2 files changed

Lines changed: 23 additions & 4 deletions

File tree

telegraf/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ This is an alpine based image for running telegraf within a kubernetes cluster.
66
## Configuration
77
Telegraf configuration is based largely on a toml file that is passed in when the binary starts. The issue with doing this in a containerized environment is how can you "dynamically" build this file based on values passed into the container at runtime. Therefore, this image relies on a project called [envtpl](https://github.com/arschles/envtpl) to produce the telegraf configuration file. It can take environment variables and through using go templates produce the necessary stanzas in the toml file to start telegraf. Currently, the go template only supports basic if checks and outputting values that have been set.
88

9+
## Host information
10+
You must do 2 things if you want to receive host level metrics from telegraf.
11+
* - Set the volume mounts for both `/sys` and `/proc`
12+
* - Set the environment variables `HOST_PROC` and `HOST_SYS` to the values of where `/sys` and `/proc` are mounted in the container. Example entries can be found in the [manifest](manifests/deis-monitor-telegraf-daemon.yaml).
13+
914
## Development
1015
There is a make file provided with the project that can build the image, push it to a registry, and deploy it to a kubernetes cluster.
1116

@@ -21,4 +26,4 @@ There is a make file provided with the project that can build the image, push it
2126
* `kube-delete`: Remove the daemonset from kubernetes
2227
* `kube-create`: Create the daemonset in kubernetes
2328
* `kube-update`: Remove the daemonset and create a new one (this is useful for publishing new images)
24-
* `update-manifests`: This is a helpful target that is used to generate a temporary manifest with the dev image set in the `image` stanza.
29+
* `update-manifests`: This is a helpful target that is used to generate a temporary manifest with the dev image set in the `image` stanza.

telegraf/manifests/deis-monitor-telegraf-daemon.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,29 @@ spec:
1515
- name: deis-monitor-telegraf
1616
image: quay.io/deis/telegraf:v2-beta
1717
imagePullPolicy: Always
18-
volumeMounts:
19-
- mountPath: /var/run/docker.sock
20-
name: docker-socket
2118
env:
2219
- name: "INFLUXDB_URLS"
2320
value: http://$(DEIS_MONITOR_INFLUXDB_SERVICE_HOST):$(DEIS_MONITOR_INFLUXDB_PORT_8086_TCP_PORT)
2421
- name: "KUBERNETES_DOCKER_ENDPOINT"
2522
value: "unix:///var/run/docker.sock"
23+
- name: "HOST_PROC"
24+
value: "/rootfs/proc"
25+
- name: "HOST_SYS"
26+
value: "/rootfs/sys"
27+
# volumeMounts:
28+
# - name: sysro
29+
# mountPath: /rootfs/sys
30+
# readOnly: true
31+
# - name: procro
32+
# mountPath: /rootfs/proc
33+
# readOnly: true
2634
volumes:
2735
- name: docker-socket
2836
hostPath:
2937
path: /var/run/docker.sock
38+
# - name: sysro
39+
# hostPath:
40+
# path: /sys
41+
# - name: procro
42+
# hostPath:
43+
# path: /proc

0 commit comments

Comments
 (0)