feat: use consistent labels - #64
Conversation
📝 WalkthroughWalkthroughChangesHelm label centralization
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@helm/thalamus/templates/_helpers.tpl`:
- Around line 16-19: Deployment selectors are immutable and the chart currently
changes them across upgrades. Add a pre-upgrade lifecycle hook that deletes the
affected operator, model, and EPP Deployments before recreation; update
helm/thalamus/templates/_helpers.tpl lines 16-19,
helm/thalamus/templates/models.yaml lines 21-23, and
helm/thalamus/templates/epp.yaml lines 107-109 as needed so the hook targets the
existing Deployments and the new selectors remain consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3ed921da-8607-4f57-9c01-35cd0b94fbc4
📒 Files selected for processing (4)
helm/thalamus/templates/_helpers.tplhelm/thalamus/templates/epp.yamlhelm/thalamus/templates/models.yamlhelm/thalamus/templates/operator.yaml
| {{- define "thalamus.operator.selectorLabels" -}} | ||
| app.kubernetes.io/name: {{ include "thalamus.operator.name" . }} | ||
| app.kubernetes.io/instance: {{ .Release.Name }} | ||
| app.kubernetes.io/component: operator | ||
| {{- end }} |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Deployment selector changes are breaking on upgrade — selectors are immutable.
All three Deployment selectors changed their label keys, which Kubernetes rejects on helm upgrade for existing installations. The root cause is that selector label helpers now emit different keys than the prior hardcoded values.
helm/thalamus/templates/_helpers.tpl#L16-L19:thalamus.operator.selectorLabelsremovedapp.kubernetes.io/instance— the operator Deployment selector atoperator.yamlline 65 now has fewer keys than before.helm/thalamus/templates/models.yaml#L21-L23: model DeploymentmatchLabelsswitched from hardcodedapp/llm-d.ai/inference-servinglabels toapp.kubernetes.io/name+app.kubernetes.io/component.helm/thalamus/templates/epp.yaml#L107-L109: EPP DeploymentmatchLabelsswitched from hardcodedinferencepoollabel toapp.kubernetes.io/name+app.kubernetes.io/component.
Migration options:
- Fresh install only — document that this version requires
helm uninstall+helm install(or manual deletion of affected Deployments). - Lifecycle hook — add a pre-upgrade hook that deletes the old Deployments before the upgrade creates new ones with the new selectors.
- Keep old selector keys — if upgrade compatibility is required, preserve the old label keys in the selector helpers alongside the new ones (note: you cannot add keys to an existing selector either, so this only works if the old keys were a subset of the new ones, which they are not here).
Option 1 is simplest for a chart that likely hasn't been widely deployed yet. Option 2 is the cleanest automated approach.
📍 Affects 3 files
helm/thalamus/templates/_helpers.tpl#L16-L19(this comment)helm/thalamus/templates/models.yaml#L21-L23helm/thalamus/templates/epp.yaml#L107-L109
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@helm/thalamus/templates/_helpers.tpl` around lines 16 - 19, Deployment
selectors are immutable and the chart currently changes them across upgrades.
Add a pre-upgrade lifecycle hook that deletes the affected operator, model, and
EPP Deployments before recreation; update helm/thalamus/templates/_helpers.tpl
lines 16-19, helm/thalamus/templates/models.yaml lines 21-23, and
helm/thalamus/templates/epp.yaml lines 107-109 as needed so the hook targets the
existing Deployments and the new selectors remain consistent.
Summary by CodeRabbit