Add pod.labels support to all helm charts - #258
Conversation
Port of wso2#174 (merged to 4.6.x). Adds wso2.deployment.pod.labels to all five charts, allowing custom labels to be merged into the pod template labels alongside the default deployment/node/product labels. Follows the existing wso2.deployment.pod.annotations pattern. READMEs regenerated with helm-docs.
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughThe Helm charts add optional pod label maps, defaulting to 🚥 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: 2
🤖 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 `@all-in-one/templates/am/instance-1/wso2am-deployment.yaml`:
- Around line 45-47: Protect the built-in selector labels from being overridden
by custom labels in all three deployment templates:
all-in-one/templates/am/instance-1/wso2am-deployment.yaml lines 45-47,
all-in-one/templates/am/instance-2/wso2am-deployment.yaml lines 46-48, and
distributed/control-plane/templates/control-plane/instance-1/wso2am-cp-deployment.yaml
lines 48-50. Update the custom-label rendering in each template so required
instance or control-plane selector keys retain their built-in values while
non-reserved custom labels are applied.
In
`@distributed/control-plane/templates/control-plane/instance-2/wso2am-cp-deployment.yaml`:
- Around line 49-51: Protect chart-owned selector labels from user overrides in
the label blocks of
distributed/control-plane/templates/control-plane/instance-2/wso2am-cp-deployment.yaml
(49-51), distributed/gateway/templates/gateway/wso2am-gateway-deployment.yaml
(49-51), distributed/key-manager/templates/key-manager/wso2am-km-deployment.yaml
(53-55),
distributed/traffic-manager/templates/traffic-manager/instance-1/wso2am-tm-deployment.yaml
(51-53), and
distributed/traffic-manager/templates/traffic-manager/instance-2/wso2am-tm-deployment.yaml
(52-54). Update the `toYaml .Values.wso2.deployment.pod.labels` merging or
validation so custom labels cannot override `deployment` and `product`, and also
`node` in the control-plane and both traffic-manager templates, while preserving
all other user labels.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3e046f06-4105-45c8-b27d-d348e6fce272
📒 Files selected for processing (18)
all-in-one/README.mdall-in-one/templates/am/instance-1/wso2am-deployment.yamlall-in-one/templates/am/instance-2/wso2am-deployment.yamlall-in-one/values.yamldistributed/control-plane/README.mddistributed/control-plane/templates/control-plane/instance-1/wso2am-cp-deployment.yamldistributed/control-plane/templates/control-plane/instance-2/wso2am-cp-deployment.yamldistributed/control-plane/values.yamldistributed/gateway/README.mddistributed/gateway/templates/gateway/wso2am-gateway-deployment.yamldistributed/gateway/values.yamldistributed/key-manager/README.mddistributed/key-manager/templates/key-manager/wso2am-km-deployment.yamldistributed/key-manager/values.yamldistributed/traffic-manager/README.mddistributed/traffic-manager/templates/traffic-manager/instance-1/wso2am-tm-deployment.yamldistributed/traffic-manager/templates/traffic-manager/instance-2/wso2am-tm-deployment.yamldistributed/traffic-manager/values.yaml
- Note in each chart's values.yaml that the Deployment selector keys (`deployment`, plus `node` where the chart uses it) must not be overridden via wso2.deployment.pod.labels. READMEs regenerated with helm-docs. - Add the wso2.deployment.pod block (annotations + labels) to all 14 pattern values files under resources/, which had been out of sync with the charts since the pod.annotations refactor.
Purpose
Port of #174 (merged to
4.6.x) so thatwso2.deployment.pod.labelsis available on this branch too.Goals
Add
wso2.deployment.pod.labelsconfiguration to all WSO2 APIM helm charts, enabling users to set custom labels for pod organization, monitoring, cost allocation, and policy enforcement.Approach
Added
pod.labels: {}tovalues.yamland updated the deployment templates to merge custom labels with the default labels in all 5 charts:all-in-one(2 instances)distributed/control-plane(2 instances)distributed/gatewaydistributed/key-managerdistributed/traffic-manager(2 instances)Implementation follows the existing
pod.annotationspattern for consistency.Template changes:
Usage example:
Release note
Added support for custom pod labels via
wso2.deployment.pod.labelsconfiguration in all helm charts.Documentation
README.mdfiles for all 5 charts regenerated withhelm-docs(v1.14.2).Automation tests
helm lintpasses for all 5 charts;helm templateverified with both default values (output identical to before) and custompod.labels(labels correctly merged into the pod template).Security checks
Related PRs
4.6.x)Migrations (if applicable)
N/A - Backward compatible. Default value is an empty map
{}, producing identical output to previous versions.Test environment