Skip to content

Add a chart-wide podLabels value - #55

Merged
lewisjared merged 3 commits into
mainfrom
feat/chart-wide-pod-labels
Aug 28, 2026
Merged

Add a chart-wide podLabels value#55
lewisjared merged 3 commits into
mainfrom
feat/chart-wide-pod-labels

Conversation

@lewisjared

@lewisjared lewisjared commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Adds a top-level podLabels that lands on every pod the chart renders, including the migration Job. A component's own podLabels is applied on top of it, so a per-component override still wins.

The labels stay off the Deployment selectors, which are immutable, so an existing release can take one without a reinstall.

Without this a cluster convention such as an environment label had to go on after rendering, through a Kustomize post-renderer with a separate patch per workload kind.

Summary by CodeRabbit

  • New Features

    • Added a chart-wide podLabels setting for applying labels to every rendered pod, including migration jobs.
    • Component-specific pod labels continue to be supported and can override global values.
    • Global labels remain separate from immutable deployment selectors, allowing updates without reinstallation.
  • Documentation

    • Documented the new global parameter and its use for cluster-wide labelling conventions.

Adds a top-level `podLabels` that lands on every pod the chart renders,
including the migration Job, with each component's own `podLabels` applied on top.
The labels stay off the Deployment selectors, which are immutable,
so an existing release can take one without a reinstall.

Without this a cluster convention such as an environment label had to go on
after rendering, through a Kustomize post-renderer per workload kind.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 48 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f4d2fba-023c-4ae3-84ee-2348afb9f291

📥 Commits

Reviewing files that changed from the base of the PR and between e7ace2c and 58b51df.

📒 Files selected for processing (3)
  • helm/README.md
  • helm/templates/_helpers.tpl
  • tests/test_helm_render.py
📝 Walkthrough

Walkthrough

The Helm chart adds a global podLabels value, renders it on all workload pods, preserves component-specific labels and Deployment selectors, documents the setting, and adds rendering tests.

Changes

Global pod label configuration

Layer / File(s) Summary
Define and render global pod labels
helm/values.yaml, helm/templates/_helpers.tpl, helm/templates/api/deployment.yaml, helm/templates/flower/deployment.yaml, helm/templates/providers/deployment.yaml, helm/templates/migrate-job.yaml, helm/README.md, changelog/55.feature.md
The chart defines podLabels, renders the labels on workload pod templates, layers component labels on top, excludes Deployment selectors, and documents the configuration.
Validate label application and precedence
tests/test_helm_render.py
Tests cover global labels on all pods, default absence, selector exclusion, and component-level overrides.

Merge Risk: 🟡 Moderate · up to e7ace

Global pod labels can overwrite selector-owned identity labels, causing Kubernetes to reject a Deployment or leave updated pods unmatched during an upgrade; because the setting applies across the chart, one bad label can affect multiple workloads. Merge should wait for reserved-key protection or explicit owner acceptance of this bounded rollout risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (8 skipped: 8 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a chart-wide podLabels value.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 1 files. (8 skipped: 8 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chart-wide-pod-labels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@lewisjared
lewisjared merged commit 7bfbf61 into main Aug 28, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 758d5348-cf54-4267-82b4-be13bd50f65a

📥 Commits

Reviewing files that changed from the base of the PR and between 4d4e521 and e7ace2c.

📒 Files selected for processing (9)
  • changelog/55.feature.md
  • helm/README.md
  • helm/templates/_helpers.tpl
  • helm/templates/api/deployment.yaml
  • helm/templates/flower/deployment.yaml
  • helm/templates/migrate-job.yaml
  • helm/templates/providers/deployment.yaml
  • helm/values.yaml
  • tests/test_helm_render.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment on lines +32 to +34
{{- with (include "ref.podLabels" .) }}
{{- . | nindent 8 }}
{{- end }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Protect selector-owned labels from configurable overrides.

Global and component podLabels are rendered after canonical selector labels. If either map contains a selector identity key such as app.kubernetes.io/name, app.kubernetes.io/instance, or the component label, the pod template can contain duplicate or mismatched values while spec.selector remains unchanged. Kubernetes may reject the Deployment or leave pods unmatched, and the same configuration can affect multiple workloads. Reject selector-reserved keys or render canonical selector labels last, with regression coverage for each Deployment.

📍 Affects 2 files
  • helm/templates/api/deployment.yaml#L32-L34 (this comment)
  • helm/templates/flower/deployment.yaml#L27-L29

Source: MCP tools

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.

1 participant