Skip to content

Conversation

@Dashing-Nelson
Copy link

@Dashing-Nelson Dashing-Nelson commented Nov 13, 2025

This pull request introduces support for adding custom labels to the generated PodMonitor resource in the cluster Helm chart, making it easier to integrate with various monitoring stacks and workflows. Additionally, the logic for PodMonitor and its relabeling configuration has been refactored to improve maintainability, with the relevant configuration now handled in a dedicated template.

PodMonitor labels support and configuration refactoring:

  • Added a new labels field under cluster.monitoring.podMonitor in values.yaml, values.schema.json, and documented it in README.md, allowing users to specify additional labels for the PodMonitor resource. [1] [2] [3]
  • Updated example and test manifests to demonstrate usage of the new labels field for PodMonitor, including sample team and environment labels. [1] [2] [3]

Refactoring PodMonitor resource generation:

  • Moved PodMonitor resource creation and relabeling configuration to a new dedicated template file podmonitor.yaml, improving separation of concerns and maintainability.
  • Removed PodMonitor relabeling and metricRelabeling configuration from cluster.yaml, centralizing this logic in the new template.
  • Updated PodMonitor enablement logic in cluster.yaml to defer resource creation to the new template, setting enablePodMonitor to false in the main spec.

closes: #647

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. chart( cluster ) Related to the cluster chart labels Nov 13, 2025
{{- end }}
{{- if not (empty .Values.cluster.monitoring.podMonitor.labels) }}
{{- with .Values.cluster.monitoring.podMonitor.labels }}
podMonitorAdditionalLabels:

Choose a reason for hiding this comment

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

This key doesn't exist in the Cluster spec for monitoring. I believe the only way to solve this issue is to externalize the PodMonitor from the Cluster resource.

Copy link
Author

Choose a reason for hiding this comment

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

Good idea. @racerand please see latest updated code.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chart( cluster ) Related to the cluster chart size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support configurable PodMonitor labels

2 participants