From 03015894ad1169e74f2ae72c6d1d836f6c2bd886 Mon Sep 17 00:00:00 2001 From: shodan Date: Sat, 14 Mar 2026 13:47:33 +0000 Subject: [PATCH] . --- victoria-monitoring/node-exporter.yaml | 77 +++++++++++++++++++ victoria-monitoring/scrape-node-exporter.yaml | 13 +++- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 victoria-monitoring/node-exporter.yaml diff --git a/victoria-monitoring/node-exporter.yaml b/victoria-monitoring/node-exporter.yaml new file mode 100644 index 0000000..06db707 --- /dev/null +++ b/victoria-monitoring/node-exporter.yaml @@ -0,0 +1,77 @@ +#creates a static pod on each flatcar node and runs node-exporter +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: node-exporter + namespace: vm +spec: + selector: + matchLabels: + app: node-exporter + updateStrategy: + type: RollingUpdate + template: + metadata: + labels: + app: node-exporter + spec: + hostNetwork: true + hostPID: true + dnsPolicy: ClusterFirstWithHostNet + tolerations: + - operator: Exists + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule + - key: node-role.kubernetes.io/master + operator: Exists + effect: NoSchedule + containers: + - name: node-exporter + image: quay.io/prometheus/node-exporter:latest + args: + - --path.rootfs=/host + - --web.listen-address=:9100 + - --collector.filesystem.mount-points-exclude=^/(dev|proc|sys|var/lib/docker/.+|var/lib/containerd/.+|var/lib/kubelet/.+)($|/) + - --collector.filesystem.fs-types-exclude=^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|sysfs|tracefs)$ + ports: + - name: metrics + containerPort: 9100 + hostPort: 9100 + protocol: TCP + securityContext: + runAsNonRoot: true + runAsUser: 65534 + runAsGroup: 65534 + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + memory: 256Mi + volumeMounts: + - name: root + mountPath: /host + mountPropagation: HostToContainer + readOnly: true + - name: sys + mountPath: /host/sys + readOnly: true + - name: proc + mountPath: /host/proc + readOnly: true + volumes: + - name: root + hostPath: + path: / + type: Directory + - name: sys + hostPath: + path: /sys + type: Directory + - name: proc + hostPath: + path: /proc + type: Directory \ No newline at end of file diff --git a/victoria-monitoring/scrape-node-exporter.yaml b/victoria-monitoring/scrape-node-exporter.yaml index e5fbe5e..241c626 100644 --- a/victoria-monitoring/scrape-node-exporter.yaml +++ b/victoria-monitoring/scrape-node-exporter.yaml @@ -16,4 +16,15 @@ spec: - pbs.undercloud.local:9100 labels: service: node-exporter - role: proxmox \ No newline at end of file + role: proxmox +--- +apiVersion: operator.victoriametrics.com/v1beta1 +kind: VMNodeScrape +metadata: + name: node-exporter + namespace: vm +spec: + jobName: node-exporter + scheme: http + port: "9100" + path: /metrics \ No newline at end of file