From 17243198ace1b1c2d5d4a76030d8e5bb0bad438d Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Mon, 28 Oct 2024 00:48:54 -0500 Subject: [PATCH] both service monitors and services added --- .../smartctl-exporter/app/helmrelease.yaml | 34 ++++++++++++++++++- .../smartctl-exporter/app/podmonitor.yaml | 13 +++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 kubernetes/apps/observability/smartctl-exporter/app/podmonitor.yaml diff --git a/kubernetes/apps/observability/smartctl-exporter/app/helmrelease.yaml b/kubernetes/apps/observability/smartctl-exporter/app/helmrelease.yaml index 72fa2271..b6ea85c7 100644 --- a/kubernetes/apps/observability/smartctl-exporter/app/helmrelease.yaml +++ b/kubernetes/apps/observability/smartctl-exporter/app/helmrelease.yaml @@ -48,7 +48,7 @@ spec: custom: true spec: httpGet: - port: 9633 + port: &port 9633 path: / readiness: *probes smartctl-exporter-vms: @@ -77,6 +77,17 @@ spec: probes: liveness: *probes readiness: *probes + service: + smartctl-exporter: + controller: smartctl-exporter + ports: + exporter: + port: *port + smartctl-exporter-vms: + controller: smartctl-exporter-vms + ports: + exporter: + port: *port persistence: dev: type: hostPath @@ -85,3 +96,24 @@ spec: globalMounts: - path: /host/dev readOnly: true + serviceMonitor: + smartctl-exporter: + serviceName: smartctl-exporter + endpoints: + - port: exporter + scheme: http + path: /metrics + interval: 1m + scrapeTimeout: 10s + smartctl-exporter-vms: + selector: + matchLabels: + app.kubernetes.io/instance: smartctl-exporter + app.kubernetes.io/name: smartctl-exporter + app.kubernetes.io/service: smartctl-exporter-smartctl-exporter-vms + endpoints: + - port: exporter + scheme: http + path: /metrics + interval: 1m + scrapeTimeout: 10s diff --git a/kubernetes/apps/observability/smartctl-exporter/app/podmonitor.yaml b/kubernetes/apps/observability/smartctl-exporter/app/podmonitor.yaml new file mode 100644 index 00000000..f95f578d --- /dev/null +++ b/kubernetes/apps/observability/smartctl-exporter/app/podmonitor.yaml @@ -0,0 +1,13 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/monitoring.coreos.com/podmonitor_v1.json +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: smartctl-exporter +spec: + namespaceSelector: + matchNames: + - observability + selector: + matchLabels: + app.kubernetes.io/name: smartctl-exporter