From af31ee53bca1f597b0d85e295de3a7071ecd6802 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Wed, 4 Sep 2024 19:43:31 -0400 Subject: [PATCH] feat: collect node-exporter metrics from essential box --- .../essential-node-exporter.yaml | 47 +++++++++++++++++++ .../external-monitors/kustomization.yaml | 3 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 cluster/apps/monitoring/external-monitors/essential-node-exporter.yaml diff --git a/cluster/apps/monitoring/external-monitors/essential-node-exporter.yaml b/cluster/apps/monitoring/external-monitors/essential-node-exporter.yaml new file mode 100644 index 0000000..cf0abf2 --- /dev/null +++ b/cluster/apps/monitoring/external-monitors/essential-node-exporter.yaml @@ -0,0 +1,47 @@ +kind: Service +apiVersion: v1 +metadata: + name: essential-node-exporter + namespace: monitoring + labels: + app: essential-node-exporter +spec: + type: ClusterIP + ports: + - name: metrics + port: 9100 + targetPort: 9100 +--- +kind: Endpoints +apiVersion: v1 +metadata: + name: essential-node-exporter + namespace: monitoring +subsets: +- addresses: + - ip: 192.168.10.41 + ports: + - name: metrics + port: 9100 +--- +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: essential-node-exporter + namespace: monitoring + labels: + release: kube-prometheus-stack +spec: + selector: + matchLabels: + app: essential-node-exporter + endpoints: + - port: metrics + interval: 60s + scrapeTimeout: 15s + path: /metrics + relabelings: + - targetLabel: job + replacement: node-exporter + - targetLabel: instance + replacement: essential \ No newline at end of file diff --git a/cluster/apps/monitoring/external-monitors/kustomization.yaml b/cluster/apps/monitoring/external-monitors/kustomization.yaml index 66ed3df..cd8cb83 100644 --- a/cluster/apps/monitoring/external-monitors/kustomization.yaml +++ b/cluster/apps/monitoring/external-monitors/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ./air-quality.yaml -- ./air-quality-dashboard.yaml \ No newline at end of file +- ./air-quality-dashboard.yaml +- ./essential-node-exporter.yaml \ No newline at end of file