mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-06 01:11:23 +00:00
Merge pull request #1642 from rneugeba/prometheus
Add prometheus node_exporter package
This commit is contained in:
40
examples/node_exporter.yml
Normal file
40
examples/node_exporter.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
kernel:
|
||||
image: "mobylinux/kernel:4.9.x"
|
||||
cmdline: "console=ttyS0 page_poison=1"
|
||||
init:
|
||||
- linuxkit/init:63eed9ca7a09d2ce4c0c5e7238ac005fa44f564b
|
||||
- linuxkit/init:42fe8cb1508b3afed39eb89821906e3cc7a70551
|
||||
- linuxkit/runc:b0fb122e10dbb7e4e45115177a61a3f8d68c19a9
|
||||
- linuxkit/containerd:fe1b7f438a234cb6481c6538295115eac2a0596d
|
||||
services:
|
||||
- name: rngd
|
||||
image: "mobylinux/rngd:3dad6dd43270fa632ac031e99d1947f20b22eec9"
|
||||
capabilities:
|
||||
- CAP_SYS_ADMIN
|
||||
oomScoreAdj: -800
|
||||
- name: dhcpcd
|
||||
image: "linuxkit/dhcpcd:48e249ebef6a521eed886b3bce032db69fbb4afa"
|
||||
binds:
|
||||
- /var:/var
|
||||
- /tmp:/etc
|
||||
capabilities:
|
||||
- CAP_NET_ADMIN
|
||||
- CAP_NET_BIND_SERVICE
|
||||
- CAP_NET_RAW
|
||||
net: host
|
||||
oomScoreAdj: -800
|
||||
- name: node_exporter
|
||||
image: "linuxkit/node_exporter:0c7c1588e4cbce9cc946c1a84d3902b38b4b7ada"
|
||||
capabilities:
|
||||
- all
|
||||
net: host
|
||||
pid: host
|
||||
binds:
|
||||
- /proc:/host/proc
|
||||
- /sys:/host/sys
|
||||
- /:/rootfs
|
||||
trust:
|
||||
image:
|
||||
- mobylinux/kernel
|
||||
outputs:
|
||||
- format: kernel+initrd
|
6
pkg/node_exporter/Dockerfile
Normal file
6
pkg/node_exporter/Dockerfile
Normal file
@@ -0,0 +1,6 @@
|
||||
FROM prom/node-exporter:v0.14.0
|
||||
|
||||
ENTRYPOINT ["/bin/node_exporter", "-collector.procfs", "/host/proc", \
|
||||
"-collector.sysfs", "/host/sys", \
|
||||
"-collector.filesystem.ignored-mount-points", \
|
||||
"^/(sys|proc|dev|host|etc)($|/)"]
|
29
pkg/node_exporter/Makefile
Normal file
29
pkg/node_exporter/Makefile
Normal file
@@ -0,0 +1,29 @@
|
||||
.PHONY: tag push clean container
|
||||
default: push
|
||||
|
||||
IMAGE=node_exporter
|
||||
SHA_IMAGE=alpine:3.5@sha256:dfbd4a3a8ebca874ebd2474f044a0b33600d4523d03b0df76e5c5986cb02d7e8
|
||||
|
||||
container: Dockerfile
|
||||
docker build --no-cache -t $(IMAGE):build .
|
||||
|
||||
hash: Dockerfile
|
||||
find $^ -type f | xargs cat | docker run --rm -i $(SHA_IMAGE) sha1sum - | sed 's/ .*//' > hash
|
||||
|
||||
push: hash container
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
(docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash) && \
|
||||
docker push linuxkit/$(IMAGE):$(shell cat hash))
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
tag: hash container
|
||||
docker pull linuxkit/$(IMAGE):$(shell cat hash) || \
|
||||
docker tag $(IMAGE):build linuxkit/$(IMAGE):$(shell cat hash)
|
||||
docker rmi $(IMAGE):build
|
||||
rm -f hash
|
||||
|
||||
clean:
|
||||
rm -rf hash
|
||||
|
||||
.DELETE_ON_ERROR:
|
Reference in New Issue
Block a user