1. Answers
  2. Deploy Node Exporter Helm Chart on Kubernetes

How do I deploy the node-exporter helm chart on Kubernetes?

In this guide, we will deploy the node-exporter Helm chart on a Kubernetes cluster using Pulumi. The node-exporter is a Prometheus exporter for hardware and OS metrics exposed by *NIX kernels, which is useful for monitoring the nodes in your Kubernetes cluster.

The following Pulumi program in TypeScript demonstrates how to deploy the node-exporter Helm chart. We will use the @pulumi/kubernetes package to interact with Kubernetes and manage the Helm release.

import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";

// Define the namespace for the Helm chart
const namespace = new k8s.core.v1.Namespace("monitoring", {
    metadata: { name: "monitoring" },
});

// Deploy the node-exporter Helm chart
const nodeExporter = new k8s.helm.v3.Chart("node-exporter", {
    chart: "prometheus-node-exporter",
    version: "3.0.1",
    fetchOpts: {
        repo: "https://prometheus-community.github.io/helm-charts",
    },
    namespace: namespace.metadata.name,
});

// Export the namespace name
export const nsName = namespace.metadata.name;

Key Points

  1. Namespace Creation: We create a Kubernetes namespace called monitoring to isolate the resources.
  2. Helm Chart Deployment: We use the k8s.helm.v3.Chart resource to deploy the prometheus-node-exporter Helm chart from the Prometheus community Helm repository.
  3. Namespace Assignment: The Helm chart is deployed within the monitoring namespace.

Summary

We have successfully deployed the node-exporter Helm chart on a Kubernetes cluster using Pulumi. This setup includes creating a dedicated namespace for the deployment and managing the Helm release with Pulumi’s Kubernetes provider. This approach ensures that the node-exporter is properly configured and running to monitor the nodes in your Kubernetes cluster.

Deploy this code

Want to deploy this code? Sign up for a free Pulumi account to deploy in a few clicks.

Sign up

New to Pulumi?

Want to deploy this code? Sign up with Pulumi to deploy in a few clicks.

Sign up