about summary refs log tree commit diff
path: root/bundles/node-exporter
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/node-exporter')
-rw-r--r--bundles/node-exporter/files/kube.yaml99
-rw-r--r--bundles/node-exporter/items.py3
-rw-r--r--bundles/node-exporter/metadata.py4
3 files changed, 60 insertions, 46 deletions
diff --git a/bundles/node-exporter/files/kube.yaml b/bundles/node-exporter/files/kube.yaml
index df10043..388f412 100644
--- a/bundles/node-exporter/files/kube.yaml
+++ b/bundles/node-exporter/files/kube.yaml
@@ -14,50 +14,61 @@ spec:
   restartPolicy: Never
   dnsPolicy: Default
   containers:
-  - name: node-exporter
-    image: quay.io/prometheus/node-exporter:v1.8.0
-    args:
-    - --path.procfs=/host/proc
-    - --path.sysfs=/host/sys
-    - --web.listen-address=:20091
-    - --no-collector.bcache
-    - --no-collector.selinux
-    - --no-collector.infiniband
-    - --no-collector.xfs
-    - --no-collector.zfs
-    - --collector.textfile.directory=/host/textfiles
-    volumeMounts:
+    - name: node-exporter
+      image: quay.io/prometheus/node-exporter:v${version}
+      args:
+      - --path.procfs=/host/proc
+      - --path.sysfs=/host/sys
+      - --path.rootfs=/host/root
+      - --web.listen-address=:20091
+      - --no-collector.bcache
+      - --no-collector.selinux
+      - --no-collector.infiniband
+      - --no-collector.xfs
+      - --no-collector.zfs
+      - --collector.textfile.directory=/host/textfiles
+      - --collector.filesystem.ignored-mount-points=^/(sys|proc|dev|run)($|/)
+      volumeMounts:
+        - name: proc
+          mountPath: /host/proc
+          readOnly:  true
+        - name: sys
+          mountPath: /host/sys
+          readOnly: true
+        - name: root
+          mountPath: /host/root
+          mountPropagation: HostToContainer
+          readOnly:  true
+        - name: textfiles
+          mountPath: /host/textfiles
+          readOnly: true
+      ports:
+        - containerPort: 20091
+          protocol: TCP
+      hostNetwork: true
+      hostPID: true
+      livenessProbe:
+        exec:
+          command: ["wget", "-qO-", "http://localhost:20091/"]
+      resources:
+        limits:
+          cpu: 10m
+          memory: 50Mi
+
+  volumes:
     - name: proc
-      mountPath: /host/proc
-      readOnly:  true
+      hostPath:
+        path: /proc
+        type: Directory
     - name: sys
-      mountPath: /host/sys
-      readOnly: true
+      hostPath:
+        path: /sys
+        type: Directory
+    - name: root
+      hostPath:
+        path: /
+        type: Directory
     - name: textfiles
-      mountPath: /host/textfiles
-      readOnly: true
-    ports:
-    - containerPort: 20091
-      protocol: TCP
-    hostNetwork: true
-    hostPID: true
-    resources:
-      limits:
-        cpu: 10m
-        memory: 50Mi
-      requests:
-        cpu: 1m
-        memory: 10Mi
-  volumes:
-  - name: proc
-    hostPath:
-      path: /proc
-      type: Directory
-  - name: sys
-    hostPath:
-      path: /sys
-      type: Directory
-  - name: textfiles
-    hostPath:
-      path: /run/prom
-      type: DirectoryOrCreate
+      hostPath:
+        path: /run/prom
+        type: DirectoryOrCreate
diff --git a/bundles/node-exporter/items.py b/bundles/node-exporter/items.py
index 263ac95..02a892f 100644
--- a/bundles/node-exporter/items.py
+++ b/bundles/node-exporter/items.py
@@ -1,6 +1,7 @@
 files = {
     "/etc/deployments/node-exporter/kube.yaml": {
-        "content_type": "text",
+        "content_type": "mako",
+        "context": node.metadata.get("containers")["node-exporter"],
         "source": "kube.yaml",
         "triggers": {"svc_s6rc:node-exporter:restart"},
     },
diff --git a/bundles/node-exporter/metadata.py b/bundles/node-exporter/metadata.py
index 7b60c10..e635c5f 100644
--- a/bundles/node-exporter/metadata.py
+++ b/bundles/node-exporter/metadata.py
@@ -1,6 +1,8 @@
 defaults = {
     "containers": {
-        "node-exporter": {},
+        "node-exporter": {
+            "version": "1.10.2",
+        },
     },
     "metrics": {
         "node-exporter": {},