Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fluent-bit] fix(fluent-bit): servicemonitor label fix #3604

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Antvirf
Copy link

@Antvirf Antvirf commented Mar 15, 2025

Remove release label from ServiceMonitor

Rationale

Prometheus operator is configured to scrape ServiceMonitor objects based on labels, and the common way to do this is by the release label of the Prometheus operator itself. Having a chart include its own release label in the object breaks this functionality without much added benefit.

This is already the way e.g. Grafana Alloy chart is set up.

Current behaviour

# Produces two release labels, which k8s won't accept, and helm install fails
$ helm template . --set serviceMonitor.enabled=true --set serviceMonitor.additionalLabels.release=prometheus-stack | grep -A10 "kind: ServiceMonitor"
kind: ServiceMonitor
metadata:
  name: release-name-fluent-bit-loki
  labels:
    app: fluent-bit-loki
    chart: fluent-bit-2.6.0
    release: release-name
    heritage: Helm
    release: prometheus-stack
spec:
  selector:

Behaviour after this PR

# only one `release` label - works fine
$ helm template . --set serviceMonitor.enabled=true --set serviceMonitor.additionalLabels.release=prometheus-stack | grep -A10 "kind: ServiceMonitor"
kind: ServiceMonitor
metadata:
  name: release-name-fluent-bit-loki
  labels:
    app: fluent-bit-loki
    chart: fluent-bit-2.6.0
    heritage: Helm
    release: prometheus-stack

@Antvirf Antvirf requested a review from a team as a code owner March 15, 2025 03:36
@CLAassistant
Copy link

CLAassistant commented Mar 15, 2025

CLA assistant check
All committers have signed the CLA.

@Antvirf Antvirf changed the title fix(fluent-bit): servicemonitor label [fluent-bit] fix(fluent-bit): servicemonitor label Mar 15, 2025
@Antvirf Antvirf changed the title [fluent-bit] fix(fluent-bit): servicemonitor label [fluent-bit] fix(fluent-bit): servicemonitor label fix Mar 15, 2025
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.

2 participants