feat(smartctl-exporter) add smartctl-exporter (#17522)

**Description**
Prometheus exporter for disks supporting S.M.A.R.T using smartctl binary
to gather metrics.
⚒️ Fixes  # <!--(issue)-->

**⚙️ Type of change**

- [x] ⚙️ Feature/App addition
- [ ] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
Tested on local Kubernetes cluster.

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [ ] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [ ] ⚠️ My changes generate no new warnings
- [ ] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [ ] ⬆️ I increased versions for any altered app according to semantic
versioning

** App addition**

If this PR is an app addition please make sure you have done the
following.

- [x] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
This commit is contained in:
Jamie 2024-02-21 16:20:16 +00:00 committed by GitHub
parent 90c6483947
commit ed52d4f240
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 290 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
# OWNERS file for Kubernetes
OWNERS
# helm-docs templates
*.gotmpl
# docs folder
/docs
# icon
icon.png

View File

@ -0,0 +1,38 @@
annotations:
max_scale_version: 23.10.2
min_scale_version: 23.10.0
truecharts.org/SCALE-support: "true"
truecharts.org/category: metrics
truecharts.org/max_helm_version: "3.13"
truecharts.org/min_helm_version: "3.12"
truecharts.org/train: incubator
apiVersion: v2
appVersion: 0.11.0
dependencies:
- name: common
version: 17.2.22
repository: oci://tccr.io/truecharts
condition: ""
alias: ""
tags: []
import-values: []
deprecated: false
description: Prometheus exporter for SMART using smartctl binary to gather metrics.
home: https://truecharts.org/charts/incubator/smartctl-exporter
icon: https://truecharts.org/img/hotlink-ok/chart-icons/smartctl-exporter.png
keywords:
- prometheus
- smartctl-exporter
- monitoring
kubeVersion: ">=1.24.0-0"
maintainers:
- name: TrueCharts
email: info@truecharts.org
url: https://truecharts.org
name: smartctl-exporter
sources:
- https://github.com/truecharts/charts/tree/master/charts/incubator/smartctl-exporter
- https://github.com/prometheus-community/smartctl_exporter
- https://hub.docker.com/r/prometheuscommunity/smartctl-exporter
type: application
version: 0.0.1

View File

@ -0,0 +1,28 @@
---
title: README
---
## General Info
TrueCharts can be installed as both _normal_ Helm Charts or as Apps on TrueNAS SCALE.
However only installations using the TrueNAS SCALE Apps system are supported.
For more information about this App, please check the docs on the TrueCharts [website](https://truecharts.org/charts/dependency/node-exporter)
**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/truecharts/charts/issues/new/choose)**
## Support
- Please check our [quick-start guides for TrueNAS SCALE](https://truecharts.org/manual/SCALE/guides/scale-intro).
- See the [Website](https://truecharts.org)
- Check our [Discord](https://discord.gg/tVsPTHWTtr)
- Open a [issue](https://github.com/truecharts/charts/issues/new/choose)
---
## Sponsor TrueCharts
TrueCharts can only exist due to the incredible effort of our staff.
Please consider making a [donation](https://truecharts.org/sponsor) or contributing back to the project any way you can!
_All Rights Reserved - The TrueCharts Project_

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,125 @@
# Include{groups}
questions:
# Include{global}
# Include{workload}
# Include{workloadDeployment}
# Include{replicas1}
# Include{podSpec}
# Include{containerMain}
# Include{containerBasic}
# Include{containerAdvanced}
# Include{containerConfig}
# Include{podOptions}
- variable: smartctl
label: "smartctl"
group: "App Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: metricsEndpoint
label: "Metrics Endpoint"
schema:
type: string
default: "/metrics"
required: true
- variable: pollInterval
label: "The interval between smartctl polls"
schema:
type: string
default: "60s"
required: true
- variable: rescanInterval
label: "The interval between rescanning for new/disappeared devices. If the interval is smaller than 1s no rescanning takes place."
schema:
type: string
default: "10m"
required: true
- variable: excludedDevices
label: "Regexp of devices to exclude from automatic scanning."
schema:
type: string
default: ""
required: false
- variable: logs
label: "Logs"
group: "App Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: general
label: "General Logs"
schema:
additional_attrs: true
type: dict
attrs:
- variable: level
label: "Log Level"
schema:
type: string
default: "info"
enum:
- value: "info"
description: "Info"
- value: "warn"
description: "Warnings"
- value: "error"
description: "Errors"
- value: "debug"
description: "Debug"
- variable: format
label: "General Log format"
schema:
type: string
default: "logfmt"
enum:
- value: "logfmt"
description: "Common Log Format"
- value: "json"
description: "JSON"
# Include{serviceRoot}
- variable: main
label: "Main Service"
description: "The Primary service on which the healthcheck runs, often the webUI"
schema:
additional_attrs: true
type: dict
attrs:
# Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras}
- variable: main
label: "Main Service Port Configuration"
schema:
additional_attrs: true
type: dict
attrs:
- variable: port
label: "Port"
description: "This port exposes the container port on the service"
schema:
type: int
default: 9633
required: true
# Include{serviceExpertRoot}
# Include{serviceExpert}
# Include{serviceList}
# Include{ingressRoot}
- variable: main
label: "Main Ingress"
schema:
additional_attrs: true
type: dict
attrs:
# Include{ingressDefault}
# Include{ingressAdvanced}
# Include{ingressList}
# Include{resources}
# Include{metrics}
# Include{prometheusRule}
# Include{advanced}
# Include{addons}
# Include{codeserver}
# Include{netshoot}
# Include{vpn}
# Include{documentation}

View File

@ -0,0 +1 @@
{{- include "tc.v1.common.lib.chart.notes" $ -}}

View File

@ -0,0 +1 @@
{{ include "tc.v1.common.loader.all" . }}

View File

@ -0,0 +1,67 @@
image:
repository: prometheuscommunity/smartctl-exporter
pullPolicy: IfNotPresent
tag: v0.11.0@sha256:f23634fa0c445299b9e1c5b23f82f67744e0258a8333268bc14603df984369d3
securityContext:
container:
privileged: true
runAsUser: 0
runAsGroup: 0
service:
main:
ports:
main:
protocol: http
port: 9633
workload:
main:
type: DaemonSet
podSpec:
containers:
main:
args:
- --web.listen-address
- :{{ .Values.service.main.ports.main.port }}
- --web.telemetry-path
- "{{ .Values.smartctl.metricsEndpoint }}"
- --smartctl.path
- /usr/sbin/smartctl
- --smartctl.interval
- "{{ .Values.smartctl.pollInterval }}"
- --smartctl.rescan
- "{{ .Values.smartctl.rescanInterval }}"
- --smartctl.device-exclude
- "{{ .Values.smartctl.excludedDevices }}"
- --log.level
- "{{ .Values.logs.general.level }}"
- --log.format
- "{{ .Values.logs.general.format }}"
probes:
liveness:
path: "{{ .Values.smartctl.metricsEndpoint }}"
port: main
readiness:
path: "{{ .Values.smartctl.metricsEndpoint }}"
port: main
startup:
type: tcp
port: main
metrics:
main:
enabled: true
type: "servicemonitor"
endpoints:
- port: main
path: "{{ .Values.smartctl.metricsEndpoint }}"
portal:
open:
enabled: false
smartctl:
metricsEndpoint: "/metrics"
pollInterval: "60s"
rescanInterval: "10m"
excludedDevices: ""
logs:
general:
level: info
format: logfmt