Skip to content

Feature Request: Add podLabels support in flux2 Helm chart #248

@jitendrabhalothia

Description

@jitendrabhalothia

Is your feature request related to a problem ?

Summary
Please add support for applying custom podLabels to all controllers (e.g., source-controller, kustomize-controller, helm-controller, etc.) managed by the flux2 Helm chart.

Motivation
Many users (especially in enterprise environments) require labeling of Pods for:

  • Governance
  • Compliance
  • Cost allocation (e.g., AWS Cost Explorer based on Pod labels)
  • Other charts (Bitnami, Kyverno, etc.) already allow podLabels in their Deployment specs.

Adding podLabels would bring consistency and flexibility.

Proposed Implementation
Introduce a new podLabels section under each controller (values.yaml) like:
helmController:
podLabels: key: value sourceController: podLabels: key: value kustomizeController: podLabels: key: value notificationController: podLabels: key: value

In each Deployment YAML template, inside spec.template.metadata.labels, inject:

labels: app.kubernetes.io/name: {{ include "flux2.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/part-of: flux {{- with .Values.<controller>.podLabels }} {{- toYaml . | nindent 6 }} {{- end }}

Benefits
Fully backward-compatible: If no podLabels are set, no change.

Allows users to better manage resources without needing extra patches or external admission controllers.

Aligns with standard Helm chart practices for flexibility.

Thank you!
Thanks for maintaining FluxCD and related charts! We really appreciate all the work — this enhancement would make life much easier for operators.

Describe the solution you'd like.

helmController:
podLabels:
key: value
sourceController:
podLabels:
key: value
kustomizeController:
podLabels:
key: value
notificationController:
podLabels:
key: value

Describe alternatives you've considered.

nope

Additional context.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions