Skip to content

[LFXV2-1211] Add pod annotations and labels support#45

Merged
bramwelt merged 2 commits intomainfrom
tbramwell/LFXV2-1211-pod-annotations-labels
Mar 6, 2026
Merged

[LFXV2-1211] Add pod annotations and labels support#45
bramwelt merged 2 commits intomainfrom
tbramwell/LFXV2-1211-pod-annotations-labels

Conversation

@bramwelt
Copy link
Contributor

@bramwelt bramwelt commented Mar 6, 2026

Summary

  • Add podAnnotations and podLabels values to Helm chart (default empty)
  • Update deployment template to render pod-level annotations and labels

🤖 Generated with Claude Code

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Issue: LFXV2-1211
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
@bramwelt bramwelt requested a review from a team as a code owner March 6, 2026 18:43
Copilot AI review requested due to automatic review settings March 6, 2026 18:43
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Warning

Rate limit exceeded

@bramwelt has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59debe50-a1ae-4605-ae30-237c80d19a3c

📥 Commits

Reviewing files that changed from the base of the PR and between 2ade979 and a92e40d.

📒 Files selected for processing (1)
  • charts/lfx-v2-indexer-service/values.yaml

Walkthrough

The changes add optional pod-level metadata configuration to a Kubernetes Deployment template. New podAnnotations and podLabels values are introduced, which are conditionally applied to pod metadata through Helm templating when provided.

Changes

Cohort / File(s) Summary
Pod Metadata Configuration
charts/lfx-v2-indexer-service/templates/deployment.yaml, charts/lfx-v2-indexer-service/values.yaml
Introduces conditional pod annotations and labels to the Deployment template via new podAnnotations and podLabels configuration keys in values.yaml, using Helm conditionals and toYaml for proper YAML rendering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding support for pod annotations and labels to the Helm chart.
Description check ✅ Passed The description is directly related to the changeset, accurately summarizing the addition of podAnnotations and podLabels values and the deployment template updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tbramwell/LFXV2-1211-pod-annotations-labels

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds configurable pod-level metadata to the lfx-v2-indexer-service Helm chart so operators can attach custom annotations/labels to the Deployment’s Pod template.

Changes:

  • Introduces podAnnotations and podLabels values (default empty maps).
  • Updates the Deployment template to render the configured Pod annotations and labels.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
charts/lfx-v2-indexer-service/values.yaml Adds new configurable values for pod annotations/labels.
charts/lfx-v2-indexer-service/templates/deployment.yaml Renders podAnnotations and podLabels into the Pod template metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

labels:
app: lfx-v2-indexer-service
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podLabels are rendered after the required app: lfx-v2-indexer-service label. If a user sets podLabels.app, the rendered YAML will contain duplicate app keys and can override/break the pod label so it no longer matches spec.selector.matchLabels, causing the Deployment to stop managing its Pods. Consider preventing overrides of selector-critical labels (e.g., omit/ignore reserved keys like app, or explicitly merge labels giving precedence to the chart’s required labels and/or fail template rendering when a reserved key is provided).

Suggested change
{{- toYaml . | nindent 8 }}
{{- $podLabels := omit . "app" }}
{{- toYaml $podLabels | nindent 8 }}

Copilot uses AI. Check for mistakes.
Comment on lines 106 to +108

podAnnotations: {}

Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New top-level values podAnnotations and podLabels are added without any description, while the rest of values.yaml uses inline comments to document each section/field. Add brief comments (and ideally an example) explaining what these maps apply to (Pod template metadata) and any restrictions (e.g., avoiding selector labels like app).

Suggested change
podAnnotations: {}
# podAnnotations are applied to the Pod template metadata
# Example:
# podAnnotations:
# prometheus.io/scrape: "true"
podAnnotations: {}
# podLabels are extra labels applied to the Pod template metadata
# Avoid labels that are used in selectors (e.g. "app") to prevent rollout issues
# Example:
# podLabels:
# role: "indexer-worker"

Copilot uses AI. Check for mistakes.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
charts/lfx-v2-indexer-service/values.yaml (1)

107-110: Consider adding documentation comments for consistency.

Other values in this file include helpful comments (e.g., # nats is the configuration for the NATS server). Adding similar comments for the new values would maintain consistency and improve discoverability.

📝 Suggested documentation
+# podAnnotations are annotations added to the pod template spec
 podAnnotations: {}

+# podLabels are additional labels added to the pod template spec
 podLabels: {}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@charts/lfx-v2-indexer-service/values.yaml` around lines 107 - 110, The new
top-level values podAnnotations and podLabels lack explanatory comments; add
short documentation comments above each (matching the style used elsewhere in
the file) explaining their purpose and expected format (e.g., "podAnnotations:
annotations applied to the pod metadata (map[string]string)" and "podLabels:
labels applied to the pod metadata (map[string]string)"), so users can discover
and understand how to use these keys when overriding chart values.
charts/lfx-v2-indexer-service/templates/deployment.yaml (1)

21-25: Potential conflict if podLabels contains app key.

If a user specifies app in podLabels, the resulting YAML would have duplicate keys. While most parsers take the last value, this could inadvertently break the Deployment's selector matching (Line 14).

This is a common Helm pattern and low risk since users typically wouldn't override app, but you could add a note in the values.yaml documentation warning against overriding selector labels.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@charts/lfx-v2-indexer-service/templates/deployment.yaml` around lines 21 -
25, The labels block can be shadowed if users include an "app" key in
.Values.podLabels causing duplicate keys and selector mismatches; update the
template where .Values.podLabels is rendered (labels: / app:
lfx-v2-indexer-service / {{- with .Values.podLabels }}) to exclude the "app" key
(e.g., pass the map through a filter such as omit "app" before toYaml) so the
explicit app label is authoritative, and also add a short warning in values.yaml
documentation telling users not to override the selector/app label to avoid
breaking the Deployment selector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@charts/lfx-v2-indexer-service/templates/deployment.yaml`:
- Around line 21-25: The labels block can be shadowed if users include an "app"
key in .Values.podLabels causing duplicate keys and selector mismatches; update
the template where .Values.podLabels is rendered (labels: / app:
lfx-v2-indexer-service / {{- with .Values.podLabels }}) to exclude the "app" key
(e.g., pass the map through a filter such as omit "app" before toYaml) so the
explicit app label is authoritative, and also add a short warning in values.yaml
documentation telling users not to override the selector/app label to avoid
breaking the Deployment selector.

In `@charts/lfx-v2-indexer-service/values.yaml`:
- Around line 107-110: The new top-level values podAnnotations and podLabels
lack explanatory comments; add short documentation comments above each (matching
the style used elsewhere in the file) explaining their purpose and expected
format (e.g., "podAnnotations: annotations applied to the pod metadata
(map[string]string)" and "podLabels: labels applied to the pod metadata
(map[string]string)"), so users can discover and understand how to use these
keys when overriding chart values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b722a87b-b3ff-4701-9d84-39ac58f9fe31

📥 Commits

Reviewing files that changed from the base of the PR and between 2eb232b and 2ade979.

📒 Files selected for processing (2)
  • charts/lfx-v2-indexer-service/templates/deployment.yaml
  • charts/lfx-v2-indexer-service/values.yaml

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Issue: LFXV2-1211
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Copy link

@asithade asithade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bramwelt bramwelt merged commit d55b1ea into main Mar 6, 2026
5 checks passed
@bramwelt bramwelt deleted the tbramwell/LFXV2-1211-pod-annotations-labels branch March 6, 2026 19:41
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.

3 participants