Fetch K8s Metrics on Vanilla Cluster

This page explains how to fetch Kubernetes metrics on a vanilla cluster using VictoriaMetrics, along with the optional installation of:

  • Prometheus Node Exporter

  • kube-state-metrics

It also covers configuring vmagent to push metrics to a remote VictoriaMetrics database.


Prerequisites

  • A running Kubernetes cluster

  • Helm installed and configured


Step 1: Add VictoriaMetrics Helm Repository

Add the Helm repository:

helm repo add vm https://victoriametrics.github.io/helm-charts/

Update the repository:

helm repo update

Step 2: Configure Values File

Update the values_vmdb.yaml file with the following configuration:

vmagent: additionalRemoteWrites: - url: http://VMDBSERVER:19043/insert/CLUSTERHASH/prometheus/ spec: remoteWrite: - url: http://VMDBSERVER:19043/insert/CLUSTERHASH/prometheus/ prometheus-node-exporter: enabled: true # Enable Node Exporter kube-state-metrics: enabled: true # Enable Kube-State-Metrics
Info
  • Replace VMDBSERVER with your VictoriaMetrics server hostname.

  • Replace CLUSTERHASH with your cluster identifier.

  • If you already have Node Exporter or Kube-State-Metrics deployed, update the vmagent relabel configs to point to existing services instead of enabling new ones.


Step 3: Install the Stack

Deploy the VictoriaMetrics Kubernetes stack:

helm install vmks vm/victoria-metrics-k8s-stack -f values_vmdb.yaml -n pulse

This installation includes:

  • VictoriaMetrics Operator

  • vmagent

  • Node Exporter (optional)

  • Kube-State-Metrics (optional)


Deploy vmagent only (Without Helm)

If you already have:

  • Prometheus Node Exporter

  • kube-state-metrics

Running in your cluster, you do not need to install the full VictoriaMetrics stack via Helm.

Instead, deploy only vmagent using Kubernetes manifests. Edit the configuration accordingly.


Summary

This setup enables:

  • Collection of node-level and cluster-level metrics

  • Remote write to VictoriaMetrics backend

  • Flexible integration with existing monitoring components