From cb4076d21cc7da9101c870b69198247f915ee568 Mon Sep 17 00:00:00 2001 From: Pierig Le Saux Date: Tue, 30 Dec 2025 20:32:57 -0500 Subject: [PATCH] node-exporter initial commit --- ix-dev/community/node-exporter/README.md | 5 + ix-dev/community/node-exporter/app.yaml | 40 ++++ ix-dev/community/node-exporter/item.yaml | 9 + ix-dev/community/node-exporter/ix_values.yaml | 8 + ix-dev/community/node-exporter/questions.yaml | 196 ++++++++++++++++++ .../templates/docker-compose.yaml | 36 ++++ .../templates/test_values/test-values.yaml | 18 ++ 7 files changed, 312 insertions(+) create mode 100644 ix-dev/community/node-exporter/README.md create mode 100644 ix-dev/community/node-exporter/app.yaml create mode 100644 ix-dev/community/node-exporter/item.yaml create mode 100644 ix-dev/community/node-exporter/ix_values.yaml create mode 100644 ix-dev/community/node-exporter/questions.yaml create mode 100644 ix-dev/community/node-exporter/templates/docker-compose.yaml create mode 100644 ix-dev/community/node-exporter/templates/test_values/test-values.yaml diff --git a/ix-dev/community/node-exporter/README.md b/ix-dev/community/node-exporter/README.md new file mode 100644 index 0000000000..a719d32de3 --- /dev/null +++ b/ix-dev/community/node-exporter/README.md @@ -0,0 +1,5 @@ +# Node Exporter + +Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, written in Go with pluggable metric collectors. + +https://github.com/prometheus/node_exporter diff --git a/ix-dev/community/node-exporter/app.yaml b/ix-dev/community/node-exporter/app.yaml new file mode 100644 index 0000000000..493689557d --- /dev/null +++ b/ix-dev/community/node-exporter/app.yaml @@ -0,0 +1,40 @@ +app_version: 1.10.2 +capabilities: [] +categories: +- monitoring +changelog_url: https://github.com/prometheus/node_exporter/releases +date_added: '2025-12-30' +description: Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, + written in Go with pluggable metric collectors. +home: https://github.com/prometheus/node_exporter +host_mounts: +- description: Required to read the processes information. + host_path: /proc +- description: Required to read the system information. + host_path: /sys +- description: Required to read the root filesystem information. + host_path: / +icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/prometheus/icon/color/prometheus-icon-color.png +keywords: +- prometheus +- exporter +- metrics +- monitoring +lib_version: 2.1.74 +lib_version_hash: 7ee6d601c170a17717109c91dde4297ae669728a57405cef7f49b8ef931a07d1 +maintainers: +- email: dev@truenas.com + name: truenas + url: https://www.truenas.com/ +name: node-exporter +run_as_context: +- description: Node Exporter runs as non-root user. + gid: 568 + group_name: apps + uid: 568 + user_name: apps +sources: +- https://github.com/prometheus/node_exporter +title: Node Exporter +train: community +version: 1.0.0 diff --git a/ix-dev/community/node-exporter/item.yaml b/ix-dev/community/node-exporter/item.yaml new file mode 100644 index 0000000000..a00dbf7ee5 --- /dev/null +++ b/ix-dev/community/node-exporter/item.yaml @@ -0,0 +1,9 @@ +categories: +- monitoring +icon_url: https://raw.githubusercontent.com/cncf/artwork/master/projects/prometheus/icon/color/prometheus-icon-color.png +screenshots: [] +tags: +- prometheus +- exporter +- metrics +- monitoring diff --git a/ix-dev/community/node-exporter/ix_values.yaml b/ix-dev/community/node-exporter/ix_values.yaml new file mode 100644 index 0000000000..543122f34c --- /dev/null +++ b/ix-dev/community/node-exporter/ix_values.yaml @@ -0,0 +1,8 @@ +images: + image: + repository: quay.io/prometheus/node-exporter + tag: "v1.10.2" + pull_policy: IfNotPresent + +consts: + container_name: node-exporter diff --git a/ix-dev/community/node-exporter/questions.yaml b/ix-dev/community/node-exporter/questions.yaml new file mode 100644 index 0000000000..9cad61cbeb --- /dev/null +++ b/ix-dev/community/node-exporter/questions.yaml @@ -0,0 +1,196 @@ +groups: + - name: Node Exporter Configuration + description: Configure Node Exporter + - name: User and Group Configuration + description: Configure User and Group for Node Exporter + - name: Network Configuration + description: Configure Network for Node Exporter + - name: Storage Configuration + description: Configure Storage for Node Exporter + - name: Resources Configuration + description: Configure Resources for Node Exporter + +questions: + - variable: TZ + group: Node Exporter Configuration + label: Timezone + schema: + type: string + default: Etc/UTC + required: true + $ref: + - definitions/timezone + + - variable: node_exporter + group: Node Exporter Configuration + label: Node Exporter Settings + schema: + type: dict + attrs: + - variable: collector_mount_points_exclude + label: Exclude Mount Points + description: Regex of mount points to exclude from the filesystem collector. + schema: + type: string + default: "^/(sys|proc|dev|host|etc)($|/)" + - variable: additional_args + label: Additional Arguments + schema: + type: list + default: [] + items: + - variable: arg + label: Argument + schema: + type: string + required: true + + - variable: run_as + group: User and Group Configuration + label: User and Group Configuration + schema: + type: dict + attrs: + - variable: user + label: UserID + schema: + type: int + default: 568 + required: true + - variable: group + label: GroupID + schema: + type: int + default: 568 + required: true + + - variable: network + group: Network Configuration + label: Network Configuration + schema: + type: dict + attrs: + - variable: host_network + label: Host Network + description: | + Use the host network stack.
+ Note: This will disable the port configuration below and the application will bind directly to the host port. + schema: + type: boolean + default: true + - variable: web_port + label: Web Port + schema: + type: dict + show_if: [["host_network", "=", false]] + attrs: + - variable: bind_mode + label: Port Bind Mode + description: | + The port bind mode.
+ - Publish: The port will be published on the host for external access.
+ - Expose: The port will be exposed for inter-container communication.
+ - None: The port will not be exposed or published.
+ Note: If the Dockerfile defines an EXPOSE directive, + the port will still be exposed for inter-container communication regardless of this setting. + schema: + type: string + default: "published" + enum: + - value: "published" + description: Publish port on the host for external access + - value: "exposed" + description: Expose port for inter-container communication + - value: "" + description: None + - variable: port_number + label: Port Number + schema: + type: int + default: 9100 + min: 1 + max: 65535 + required: true + - variable: host_ips + label: Host IPs + description: IPs on the host to bind this port + schema: + type: list + show_if: [["bind_mode", "=", "published"]] + default: [] + items: + - variable: ip + label: IP + schema: + type: string + required: true + + - variable: storage + group: Storage Configuration + label: Storage Configuration + schema: + type: dict + attrs: + - variable: additional_storage + label: Additional Storage + schema: + type: list + default: [] + items: + - variable: storage + label: Storage + schema: + type: dict + attrs: + - variable: mount_path + label: Mount Path + schema: + type: string + required: true + - variable: type + label: Type + schema: + type: string + default: host_path + enum: + - value: host_path + description: Host Path + - variable: host_path_config + label: Host Path Configuration + schema: + type: dict + attrs: + - variable: path + label: Host Path + schema: + type: string + required: true + - variable: read_only + label: Read Only + schema: + type: boolean + default: false + + - variable: resources + group: Resources Configuration + label: Resources Configuration + schema: + type: dict + attrs: + - variable: limits + label: Limits + schema: + type: dict + attrs: + - variable: cpus + label: CPUs + schema: + type: float + default: 1.0 + required: true + - variable: memory + label: Memory (MB) + schema: + type: int + default: 512 + required: true diff --git a/ix-dev/community/node-exporter/templates/docker-compose.yaml b/ix-dev/community/node-exporter/templates/docker-compose.yaml new file mode 100644 index 0000000000..f6096c03de --- /dev/null +++ b/ix-dev/community/node-exporter/templates/docker-compose.yaml @@ -0,0 +1,36 @@ +{% set tpl = ix_lib.base.render.Render(values) %} + +{% set container = tpl.add_container(values.consts.container_name, "image") %} +{% do container.set_user(values.run_as.user, values.run_as.group) %} +{% do container.clear_caps() %} + +{# Mounts for node-exporter to see the host #} +{% do container.add_storage("/host/proc", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/proc"}}) %} +{% do container.add_storage("/host/sys", {"type": "host_path", "read_only": true, "host_path_config": {"path": "/sys"}}) %} + +{% if values.network.host_network %} + {% do container.set_network_mode("host") %} +{% else %} + {% do container.add_port(values.network.web_port) %} +{% endif %} + +{% set args = ["--path.procfs=/host/proc", "--path.sysfs=/host/sys"] %} +{% if values.node_exporter.collector_mount_points_exclude %} + {% do args.append("--collector.filesystem.mount-points-exclude=" + values.node_exporter.collector_mount_points_exclude) %} +{% endif %} +{% if values.node_exporter.additional_args %} + {% do args.extend(values.node_exporter.additional_args) %} +{% endif %} +{% do container.set_command(args) %} + +{% do container.healthcheck.set_test("wget", {"port": values.network.web_port.port_number, "path": "/"}) %} + +{% for store in values.storage.additional_storage %} + {% do container.add_storage(store.mount_path, store) %} +{% endfor %} + +{% if not values.network.host_network %} + {% do tpl.portals.add(values.network.web_port) %} +{% endif %} + +{{ tpl.render() | tojson }} diff --git a/ix-dev/community/node-exporter/templates/test_values/test-values.yaml b/ix-dev/community/node-exporter/templates/test_values/test-values.yaml new file mode 100644 index 0000000000..868a4179c7 --- /dev/null +++ b/ix-dev/community/node-exporter/templates/test_values/test-values.yaml @@ -0,0 +1,18 @@ +TZ: Etc/UTC +node_exporter: + collector_mount_points_exclude: "^/(sys|proc|dev|host|etc)($|/)" + additional_args: [] +run_as: + user: 568 + group: 568 +network: + host_network: true + web_port: + bind_mode: published + port_number: 9100 +storage: + additional_storage: [] +resources: + limits: + cpus: 1.0 + memory: 512