Skip to content

Export Kubernetes cluster metrics to a remote monitoring host#223

Merged
mattkjames7 merged 10 commits intomainfrom
feat/kubernetes-cluster-metrics
Apr 22, 2026
Merged

Export Kubernetes cluster metrics to a remote monitoring host#223
mattkjames7 merged 10 commits intomainfrom
feat/kubernetes-cluster-metrics

Conversation

@mattkjames7
Copy link
Copy Markdown
Contributor

@mattkjames7 mattkjames7 commented Apr 14, 2026

Summary

This branch extends remote monitoring for both memgraph and memgraph-high-availability charts by adding optional Kubernetes cluster metrics scraping to vmagentRemote.

What’s added

  • vmagentRemote.kubernetes support in both vmagent templates:
    • optional scrape jobs for kube-state-metrics, node-exporter, and kubelet
    • optional kubelet “additional metrics” scrape path support
  • Fail-fast template validation for required Kubernetes scraping settings (targets, API server address, metrics paths).
  • Conditional Kubernetes RBAC resources (ServiceAccount, ClusterRole, ClusterRoleBinding) and conditional serviceAccountName usage when Kubernetes scraping is enabled.
  • New values schema in both charts:
    • charts/memgraph/values.yaml
    • charts/memgraph-high-availability/values.yaml
  • Updated top-level README.md with configuration guidance.
  • Added runnable example values files:
    • examples/remote-monitoring/values-standalone-k8s-metrics.yaml
    • examples/remote-monitoring/values-ha-k8s-metrics.yaml

Impact

  • Default behavior is unchanged unless vmagentRemote.kubernetes.enabled=true.
  • When enabled, vmagent can forward both Memgraph exporter metrics and broader Kubernetes node/workload metrics to the configured remote_write backend.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds optional Kubernetes infrastructure metrics scraping to the vmagentRemote component in both Memgraph Helm charts, allowing forwarding of kube-state-metrics, node-exporter, and kubelet metrics to a remote_write backend alongside Memgraph exporter metrics.

Changes:

  • Introduces vmagentRemote.kubernetes.* values and appends optional Kubernetes scrape jobs to vmagent config.
  • Adds conditional RBAC (ServiceAccount/ClusterRole/ClusterRoleBinding) and conditional serviceAccountName usage when Kubernetes scraping is enabled.
  • Updates documentation and provides runnable example values for standalone and HA deployments.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
examples/remote-monitoring/values-standalone-k8s-metrics.yaml Adds an example enabling remote_write plus Kubernetes scrape jobs (standalone).
examples/remote-monitoring/values-ha-k8s-metrics.yaml Adds an example enabling remote_write plus Kubernetes scrape jobs (HA).
charts/memgraph/values.yaml Adds vmagentRemote.kubernetes configuration defaults/options for standalone chart.
charts/memgraph/templates/vmagent.yaml Appends Kubernetes scrape jobs, validations, and conditional RBAC/SA wiring for standalone chart.
charts/memgraph-high-availability/values.yaml Adds vmagentRemote.kubernetes configuration defaults/options for HA chart.
charts/memgraph-high-availability/templates/vmagent.yaml Appends Kubernetes scrape jobs, validations, and conditional RBAC/SA wiring for HA chart.
README.md Documents how to enable Kubernetes infrastructure scraping with vmagentRemote and links examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread charts/memgraph/templates/vmagent.yaml Outdated
Comment thread charts/memgraph-high-availability/templates/vmagent.yaml Outdated
Comment thread charts/memgraph-high-availability/templates/vmagent.yaml Outdated
Comment thread charts/memgraph-high-availability/templates/vmagent.yaml Outdated
Comment thread charts/memgraph-high-availability/templates/vmagent.yaml Outdated
Comment thread charts/memgraph/templates/vmagent.yaml Outdated
Comment thread charts/memgraph/templates/vmagent.yaml Outdated
Comment thread charts/memgraph/templates/vmagent.yaml Outdated
Comment thread charts/memgraph/values.yaml Outdated
Comment thread examples/remote-monitoring/values-ha-k8s-metrics.yaml Outdated
@mattkjames7 mattkjames7 marked this pull request as ready for review April 16, 2026 16:47
@mattkjames7 mattkjames7 requested a review from colinbarry April 16, 2026 17:00
Copy link
Copy Markdown
Collaborator

@antejavor antejavor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving it to @as51340 for 🟢 since he is the most active operator here.

Comment thread charts/memgraph-high-availability/templates/vmagent.yaml Outdated
Comment thread charts/memgraph-high-availability/templates/vmagent.yaml Outdated
Comment thread charts/memgraph-high-availability/values.yaml Outdated
Comment thread charts/memgraph/templates/vmagent.yaml Outdated
Comment thread charts/memgraph/values.yaml Outdated
Comment thread README.md
Comment thread charts/memgraph-high-availability/values.yaml
Comment thread charts/memgraph-high-availability/values.yaml
Comment thread examples/remote-monitoring/values-ha-k8s-metrics.yaml
@as51340
Copy link
Copy Markdown
Collaborator

as51340 commented Apr 21, 2026

Merge after fixing CI

@mattkjames7 mattkjames7 merged commit e108ec3 into main Apr 22, 2026
5 of 6 checks passed
@as51340 as51340 added the memgraph-ha Memgraph HA chart issue label Apr 24, 2026
@as51340 as51340 added memgraph Memgraph standalone issue feature New non-breaking feature docs-needed Set if you think documentation needs to be updated because of this change labels Apr 24, 2026
@as51340 as51340 modified the milestones: Memgraph HA 0.2.19, Memgraph standone 0.2.19 Apr 24, 2026
@as51340 as51340 added the infrastructure Infra-related changes (e.g workflows) label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Set if you think documentation needs to be updated because of this change feature New non-breaking feature infrastructure Infra-related changes (e.g workflows) memgraph Memgraph standalone issue memgraph-ha Memgraph HA chart issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants