feat: support per-component Deployment labels and annotations#882
Open
somaz94 wants to merge 1 commit into
Open
feat: support per-component Deployment labels and annotations#882somaz94 wants to merge 1 commit into
somaz94 wants to merge 1 commit into
Conversation
Signed-off-by: somaz <genius5711@gmail.com>
905e912 to
5850a21
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds top-level
deploymentLabelsanddeploymentAnnotationsvalues, keyed per component (keda/metricsAdapter/webhooks), and wires them into themetadata.labels/metadata.annotationsof the operator, metrics-apiserver and webhooks Deployments.Why
Today the only way to set Deployment-level labels/annotations is
additionalLabels/additionalAnnotations, which are shared across every component. There is no way to give a different value per component. The use case in #418 is Datadog unified service tagging, where each Deployment needs a distinctservice(operator/metrics-apiserver/webhook).This mirrors the existing per-component
podLabels/podAnnotationsinterface exactly, so the shape is already familiar:When set alongside
additionalAnnotations, both are merged onto the Deployment.A note on the approach
In #418 you raised the question of whether to follow the existing
podLabels/podAnnotationsmap style or move toward a{component}.foo.barnested style. I went with the existing top-level map style here for consistency withpodLabels/podAnnotationsand to keep the diff small. Happy to refactor to the per-component nested style if that is the direction you prefer.Validation (local)
helm lint kedapasses.main(new keys default to{}, so existing installs see no change).helm templatewith the values above mergesadditionalAnnotations+ per-componentdeploymentAnnotations, and appends per-componentdeploymentLabels, on all three Deployments.metadata.labels/metadata.annotationson the live specs, and all pods reach Running.keda/Chart.yamlversion intentionally not bumped, per CONTRIBUTING (chart versions are released with KEDA core).Resolves #418