Skip to content

Add VictoriaMetrics k8s-stack - #874

Draft
methylDragon wants to merge 5 commits into
ch3/standalone-grafanafrom
ch3/heet-crc-prometheus-vm-grafana-apps
Draft

Add VictoriaMetrics k8s-stack#874
methylDragon wants to merge 5 commits into
ch3/standalone-grafanafrom
ch3/heet-crc-prometheus-vm-grafana-apps

Conversation

@methylDragon

Copy link
Copy Markdown
Contributor

Introduces VictoriaMetrics, restructures app configurations, and enhances Prometheus selectors.

This extensive change integrates VictoriaMetrics as a new primary observability stack, splitting it into dedicated cloud and robot telemetry applications. It modernizes Helm chart management through a new k8s-stack umbrella chart and refactors application definitions for consistency, while also adding granular ServiceMonitor and PodMonitor selector configuration for existing Prometheus deployments (to allow for a migration path (to filter out scrapes) where both exists).

Very roughly, the idea:
image

Changes

  • VictoriaMetrics Integration: Introduced a new VictoriaMetrics observability stack, built on the victoria-metrics-k8s-stack Helm chart. This stack is split into two distinct applications:
    • victoriametrics-cloudmetrics: For cloud service and Kubernetes infrastructure telemetry.
    • victoriametrics-robotmetrics: For robot edge telemetry, with separate cloud (ingestion/storage/alerting) and robot (local scraping agents) deployment targets.
  • Configurable Prometheus Selectors: Modified the Prometheus prometheus-operator.yaml to dynamically inject serviceMonitorSelector and podMonitorSelector values, allowing operators to customize which ServiceMonitors and PodMonitors Prometheus will discover.
  • Application Structure Refinement: Refactored the application chart directory structure, moving victoriametrics-cloudmetrics and victoriametrics-robotmetrics under a new src/app_charts/victoriametrics/ parent directory.
  • Bazel Build Rule Updates: Updated src/app_charts/BUILD.bazel to support nested application paths (e.g., victoriametrics/victoriametrics-cloudmetrics), extracting the final component as the app name. New BUILD.bazel files were added for the VictoriaMetrics sub-apps.
  • New Exporters and Network Components: Added a smartctl-exporter (DaemonSet, Service, ServiceMonitor) for robot metrics. Introduced Ingress and HTTPRoute definitions for VictoriaMetrics query and write endpoints, configured with authentication mechanisms.
  • Third-Party Dependencies: Added new Helm chart dependencies victoria-metrics-k8s-stack (v0.91.0) under third_party/.

Extract Grafana from the Prometheus application, enabling it to be
deployed and managed independently.

#### Why

Previously, Grafana was deployed as a component of the Prometheus
operator chart, which tightly coupled its lifecycle and configuration
to Prometheus. This change decouples Grafana, allowing for:

-   **Independent Management:** Grafana can now be configured, deployed,
    and updated separately from Prometheus.
-   **Clearer Ownership:** Grafana resources are now owned by its own
    dedicated application definition.
-   **Reduced Conflicts:** Explicitly disables Grafana within the
    Prometheus chart and ensures CRD ownership is handled correctly,
    preventing resource conflicts.

#### The code changes include:

-   Adding a new `grafana` application definition under `src/app_charts`.
-   Moving Grafana's HTTPRoute and Ingress configurations to the new app.
-   Configuring the standalone Grafana to use the `kube-prometheus-stack`
    Helm chart, but with only Grafana components enabled.
-   Disabling Grafana within the `prometheus` application's chart.

Signed-off-by: methylDragon <methylDragon@intrinsic.ai>
Adapted from original: #852

This change introduces VictoriaMetrics as a new monitoring solution, implemented as two distinct applications for scalable and flexible metrics collection and storage:

-   **victoriametrics-cloudmetrics:** Deploys a VictoriaMetrics cluster (vmstorage, vminsert, vmselect) and vmagent to collect and store metrics from the Kubernetes cloud cluster (e.g., kube-state-metrics, kubelet/cAdvisor).
-   **victoriametrics-robotmetrics:** Establishes a cloud-side VictoriaMetrics cluster and vmalert for robot metrics, alongside robot-side agents (vmagent, node-exporter, smartctl-exporter) for local scraping and remote writing.

To support the newer VictoriaMetrics Helm charts and their dependencies, the hermetic Helm 3 binary has been upgraded to v3.21.3. This version is compatible with features like victoria-metrics-common templates that were incompatible with the older Helm v3.9.0.

This also includes adding the necessary Bazel BUILD rules and pulling in new third-party Helm chart dependencies for VictoriaMetrics components (agent, alert, cluster) and Grafana.

Signed-off-by: methylDragon <methylDragon@intrinsic.ai>
This change reorganizes the VictoriaMetrics application charts into a
nested directory structure (`src/app_charts/victoriametrics/`) for
better logical grouping and clarity.

Key updates include:
*   **Consolidated Structure:** Moves `victoriametrics-robotmetrics` and
    `victoriametrics-cloudmetrics` under a unified `victoriametrics/` path.
*   **Standardized Naming:** Aligns release names, Kubernetes resource names,
    and Helm value variables across all VictoriaMetrics components for
    improved consistency (e.g., `victoriametrics-cloudmetrics-agent`,
    `victoriametrics_robotmetrics_ingress_auth_url`).
*   **Enhanced vmagent Extensibility:** Adds templating to inject custom
    sidecar containers, volumes, and volume mounts into `vmagent` deployments,
    allowing for flexible integration patterns like credential management.
*   **Updated Chart Versions:** Bumps `victoria-metrics-cluster` to 0.48.0
    and `victoria-metrics-alert` to 0.46.0, and introduces `victoria-metrics-agent`
    0.45.0 for the cloud-side robotmetrics ingestion proxy.
*   **Improved Documentation:** Provides new `README.md` files detailing
    the VictoriaMetrics architecture and sub-component roles.
*   **Bazel Build Updates:** Adjusts `BUILD.bazel` rules to support the
    new nested chart paths.

Signed-off-by: methylDragon <methylDragon@intrinsic.ai>
…overy

This change enhances monitoring configurations by:

*   **Prometheus:** Allows users to define custom `serviceMonitorSelector` and `podMonitorSelector` via Helm values. If not specified, these fields are omitted from the Prometheus CRD, leveraging the Prometheus Operator's default behavior to universally match `ServiceMonitor` and `PodMonitor` resources. This replaces the previous explicit "select all" match expressions in the default values.
*   **VictoriaMetrics Agent:** Replaces the legacy universal pod discovery with an annotation-driven mechanism. The `vmagent` now dynamically discovers and scrapes pods explicitly annotated with `prometheus.io/scrape: "true"`, standardizing how metrics are collected from pods.

Signed-off-by: methylDragon <methylDragon@intrinsic.ai>
@methylDragon
methylDragon force-pushed the ch3/heet-crc-prometheus-vm-grafana-apps branch from fd26c1c to 26dc4ab Compare August 18, 2026 10:17
This change migrates all VictoriaMetrics deployments to use the unified
`victoria-metrics-k8s-stack` Helm chart, replacing individual VM component
charts for `vmcluster`, `vmagent`, and `vmalert`.

This migration brings several benefits:
*   **Simplified Management:** Consolidates multiple individual VM component
    charts into a single `victoria-metrics-k8s-stack` Helm chart, streamlining
    Bazel `BUILD` rules and application definitions.
*   **Enhanced Configurability:** Introduces robust templating logic to allow
    dynamic injection of complex YAML structures (e.g., `serviceMonitorSelector`,
    `remoteWrite` configurations, `extraContainers`, `volumes`) from Helm values,
    providing greater customization flexibility.
*   **Standardized Deployment:** Ensures a consistent deployment model for both
    `victoriametrics-cloudmetrics` and `victoriametrics-robotmetrics` applications.
*   **Improved Alerting:** Adds a common `base-alerts.yaml` for essential monitoring.
@methylDragon
methylDragon force-pushed the ch3/heet-crc-prometheus-vm-grafana-apps branch from 26dc4ab to 9a55331 Compare August 18, 2026 10:23
@methylDragon
methylDragon force-pushed the ch3/standalone-grafana branch 2 times, most recently from 288f0be to adff071 Compare August 19, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant