feat: allow overriding instance label#2671
Open
fad3t wants to merge 3 commits into
Open
Conversation
Signed-off-by: Frederic Mereu <frederic.mereu@gaming1.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ca6d3345d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Frederic Mereu <frederic.mereu@gaming1.com>
Author
|
Related to #2309 |
tedkahwaji
approved these changes
May 19, 2026
Author
|
Let me know if there's anything else required to move this one forward :) Thanks! |
Author
|
Can you help move this one forward please? Thanks @tedkahwaji ! |
Author
|
Any maintainer to approve the workflow please? |
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.
Allow overriding
app.kubernetes.io/instancelabel per workloadSummary
PR #2111 (released in 3.140.0) changed the
app.kubernetes.io/instancelabel on the Agent, Cluster Agent, and Cluster Checks Runner workloads from<release-name>to<fullname>-<workload>(e.g.datadog-agent,datadog-cluster-agent). This is a breaking change for users whose NetworkPolicies — or any other selector — pin on the previous value.agents.additionalLabelsdoesn't solve the problem: it appends labels, producing duplicate keys when the key already exists in the templated label set.This PR adds three new values:
agents.instanceLabelOverrideclusterAgent.instanceLabelOverrideclusterChecksRunner.instanceLabelOverrideWhen set, each overrides the
app.kubernetes.io/instancelabel on the corresponding workload (bothmetadata.labelsandspec.template.metadata.labels). When unset (default), behavior is unchanged from currentmain.Usage
Restore the pre-3.140.0 label so existing NetworkPolicies keep matching:
Why scoped to a single label
PR #2111 only changed
app.kubernetes.io/instance. The other threeapp.kubernetes.io/*labels emitted bydatadog.pod-template-labelswere unaffected, so a genericlabelOverridesmap would be wider scope than needed. Keeping it to one string value keeps the helper diff minimal and the values surface obvious.Safety
app.kubernetes.io/instanceis not part of any DaemonSet/Deploymentselector.matchLabels(selectors useapp: <fullname>...), so overriding the value does not run into immutability issues on upgrade.Test plan
helm templatewith defaults: output is byte-identical to currentmainfor the relevant manifestshelm template … --set agents.instanceLabelOverride=datadog --set clusterAgent.instanceLabelOverride=datadog --set clusterChecksRunner.instanceLabelOverride=datadog: confirm theapp.kubernetes.io/instancevalue flips on the agent DaemonSet, cluster-agent Deployment, and cluster-checks-runner Deployment (both metadata and pod template)helm-docsregenerated (README in sync)Related