-
Notifications
You must be signed in to change notification settings - Fork 85
Description
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