Skip to content

Helm chart improvements to support custom pod labels, annotations, node selectors and adding sidecar containers to gateway runtime pod#3324

Merged
thivindu merged 2 commits into
wso2:1.xfrom
thivindu:1.x-helm-charts
May 6, 2026

Conversation

@thivindu
Copy link
Copy Markdown
Contributor

@thivindu thivindu commented May 5, 2026

This pull request enhances the configurability of the Helm charts for APK components by introducing new options for pod-level customization and deployment flexibility. The main changes add support for specifying custom pod annotations, labels, and node selectors for various components. Additionally, the gateway runtime deployment now supports injecting extra containers and volumes.

Related to -
#3321
#3323

Doc PR - wso2/docs-apk#798

Pod customization enhancements:

Gateway runtime extensibility:

  • Added support for extraContainers and extraVolumes in the gatewayRuntime deployment, allowing users to inject additional sidecar containers and volumes into the pod for advanced use cases. [1] [2] [3] [4]

@thivindu thivindu requested a review from Krishanx92 as a code owner May 5, 2026 09:52
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Walkthrough

The changes update Helm chart templates and values files to support additional Kubernetes pod metadata and scheduling configuration. Specifically, the modifications add optional pod.annotations, pod.labels, and nodeSelector configuration options to multiple deployment components (config-deployer, adapter, common-controller, rate-limiter, idp-ds, and idp-ui). The gateway-runtime deployment additionally gains support for extraContainers and extraVolumes to enable sidecar injection and custom volume mounting. The Helm templates are updated with conditional toYaml blocks to render these values when provided, while the values files establish empty defaults for all new configuration options. Documentation in README.md is also updated to reflect these new configurable fields.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description addresses most key template requirements, including Purpose, Goals, Approach, and Release notes, with links to related issues and documentation. However, several sections lack required content or detail. Add missing sections: provide explicit automation test details (unit/integration test code coverage), confirm security checks (secure coding standards, FindSecurityBugs plugin, secrets verification), document the test environment (JDK versions, OS, databases), and clarify if Training and Certification updates are applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: Helm chart enhancements for custom pod labels, annotations, node selectors, and sidecar container support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@thivindu
Copy link
Copy Markdown
Contributor Author

thivindu commented May 5, 2026

@coderabbitai review

@thivindu thivindu requested a review from Copilot May 5, 2026 09:53
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

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

This PR improves the APK Helm charts’ deployment configurability by allowing users to set pod-level metadata (labels/annotations) and scheduling constraints (nodeSelectors) across key components, and by enabling injection of sidecar containers/volumes into the gateway runtime pod.

Changes:

  • Added deployment.pod.labels and deployment.pod.annotations value hooks and rendered them into the relevant Deployment pod templates.
  • Added deployment.nodeSelector values for components where it wasn’t present in the default values.yaml, and rendered nodeSelectors in the relevant templates.
  • Added gatewayRuntime.deployment.extraContainers and gatewayRuntime.deployment.extraVolumes support and documented the new values in the chart README.

Reviewed changes

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

Show a summary per file
File Description
helm-charts/values.yaml.template Adds pod labels/annotations defaults (and gateway runtime extraContainers/extraVolumes defaults) for templated values.
helm-charts/values.yaml Adds nodeSelector + pod labels/annotations defaults for affected components; adds gateway runtime extraContainers/extraVolumes defaults.
helm-charts/templates/idp/idp-ui/idp-ui-deployment.yaml Renders pod.labels, optional pod.annotations, and optional nodeSelector for idp-ui pods.
helm-charts/templates/idp/idp-ds/idp-ds-deployment.yaml Renders pod.labels, merges pod.annotations into existing annotations, and supports nodeSelector for idp-ds pods.
helm-charts/templates/data-plane/ratelimiter/ratelimiter-deployment.yaml Renders pod.labels, optional pod.annotations, and supports nodeSelector for ratelimiter pods.
helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml Renders pod.labels/pod.annotations, and adds support for extraContainers and extraVolumes in gateway runtime pods.
helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml Renders pod.labels and merges pod.annotations into existing annotations for common-controller pods.
helm-charts/templates/data-plane/gateway-components/adapter/adapter-deployment.yaml Renders pod.labels and merges pod.annotations into existing annotations for adapter pods.
helm-charts/templates/data-plane/config-deployer/config-ds-deployment.yaml Renders pod.labels and merges pod.annotations into existing annotations for config-deployer pods.
helm-charts/README.md Documents the newly added values (pod labels/annotations, nodeSelector, gateway runtime extraContainers/extraVolumes).

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

Copy link
Copy Markdown

@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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
helm-charts/templates/data-plane/ratelimiter/ratelimiter-deployment.yaml (1)

34-40: 💤 Low value

Functional implementation is correct; optional consistency improvement for annotations block.

The conditional annotations: block (Lines 37–40) is the right approach here since ratelimiter has no mandatory checksum/config annotation to anchor the block. Functionally sound.

For internal consistency with the labels block (Lines 34–36), the annotations could use {{- with }} and drop the redundant full value path:

♻️ Optional refactor for consistency
-{{- if .Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations }}
-      annotations:
-{{ toYaml .Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations | indent 8 }}
-{{- end }}
+{{- with .Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations }}
+      annotations:
+{{ toYaml . | indent 8 }}
+{{- end }}
🤖 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-charts/templates/data-plane/ratelimiter/ratelimiter-deployment.yaml`
around lines 34 - 40, The annotations block is functionally fine but should
mirror the labels block for consistency: replace the current conditional using
.Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations with a `{{- with
.Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations }}` block and then
render `{{ toYaml . | indent 8 }}` inside it (dropping the redundant full value
path) so labels and annotations use the same pattern; update the template around
the annotations area to use the same `with` flow as the labels block.
helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml (1)

424-426: ⚡ Quick win

Consider documenting security context expectations for extraContainers.

The pod-level seccompProfile: RuntimeDefault (Line 432) applies to all containers including injected sidecars, but the container-level hardening present on enforcer and router (allowPrivilegeEscalation: false, capabilities.drop: ["ALL"], readOnlyRootFilesystem: true, runAsNonRoot: true) does not propagate automatically. Users providing extraContainers must specify these constraints explicitly in their container definitions.

Adding a comment to the extraContainers key in values.yaml.template (or the README) noting that sidecars should define their own securityContext aligned with the pod security policy would help avoid misconfiguration.

Also applies to: 502-504

🤖 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-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml`
around lines 424 - 426, Add documentation near the values key for
extraContainers (the template variable
.Values.wso2.apk.dp.gatewayRuntime.deployment.extraContainers) to warn users
that pod-level seccompProfile: RuntimeDefault does not apply container-level
hardening and that any injected sidecars must explicitly set a securityContext
mirroring the hardening used for enforcer and router (e.g.,
allowPrivilegeEscalation: false, capabilities.drop: ["ALL"],
readOnlyRootFilesystem: true, runAsNonRoot: true). Update the
values.yaml.template (and README if present) to include this note and an example
securityContext snippet so users know to add those fields to their
extraContainers definitions. Ensure the comment references seccompProfile:
RuntimeDefault and the enforcer/router settings so it’s clear which constraints
must be replicated.
🤖 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-charts/templates/idp/idp-ui/idp-ui-deployment.yaml`:
- Around line 34-36: The current template prints user pod labels
(.Values.idp.idpui.deployment.pod.labels) after the chart's selector labels
which allows users to override selector keys; change the template so user labels
are rendered first and the selector labels (the Deployment's
spec.selector.matchLabels keys) are rendered last so selector keys remain
authoritative. Locate the block that uses "{{- with
.Values.idp.idpui.deployment.pod.labels }} {{ toYaml . | indent 8 }} {{- end }}"
and move/merge it so it appears before the selector labels block (or ensure
selector labels are rendered after it), preserving indenting (indent 8) and YAML
formatting. Ensure no duplicate keys remain after reordering so
spec.selector.matchLabels and pod.metadata.labels stay consistent.

---

Nitpick comments:
In
`@helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml`:
- Around line 424-426: Add documentation near the values key for extraContainers
(the template variable
.Values.wso2.apk.dp.gatewayRuntime.deployment.extraContainers) to warn users
that pod-level seccompProfile: RuntimeDefault does not apply container-level
hardening and that any injected sidecars must explicitly set a securityContext
mirroring the hardening used for enforcer and router (e.g.,
allowPrivilegeEscalation: false, capabilities.drop: ["ALL"],
readOnlyRootFilesystem: true, runAsNonRoot: true). Update the
values.yaml.template (and README if present) to include this note and an example
securityContext snippet so users know to add those fields to their
extraContainers definitions. Ensure the comment references seccompProfile:
RuntimeDefault and the enforcer/router settings so it’s clear which constraints
must be replicated.

In `@helm-charts/templates/data-plane/ratelimiter/ratelimiter-deployment.yaml`:
- Around line 34-40: The annotations block is functionally fine but should
mirror the labels block for consistency: replace the current conditional using
.Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations with a `{{- with
.Values.wso2.apk.dp.ratelimiter.deployment.pod.annotations }}` block and then
render `{{ toYaml . | indent 8 }}` inside it (dropping the redundant full value
path) so labels and annotations use the same pattern; update the template around
the annotations area to use the same `with` flow as the labels block.
🪄 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

Run ID: ddd0dee0-ecd2-4c41-b9c0-5d8688d4ec6f

📥 Commits

Reviewing files that changed from the base of the PR and between 5770425 and 517ca29.

📒 Files selected for processing (10)
  • helm-charts/README.md
  • helm-charts/templates/data-plane/config-deployer/config-ds-deployment.yaml
  • helm-charts/templates/data-plane/gateway-components/adapter/adapter-deployment.yaml
  • helm-charts/templates/data-plane/gateway-components/common-controller/common-controller-deployment.yaml
  • helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml
  • helm-charts/templates/data-plane/ratelimiter/ratelimiter-deployment.yaml
  • helm-charts/templates/idp/idp-ds/idp-ds-deployment.yaml
  • helm-charts/templates/idp/idp-ui/idp-ui-deployment.yaml
  • helm-charts/values.yaml
  • helm-charts/values.yaml.template

Comment on lines +34 to +36
{{- with .Values.idp.idpui.deployment.pod.labels }}
{{ toYaml . | indent 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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Prevent user labels from overriding selector labels.

On Line 34–Line 36, custom pod labels are appended after chart selector labels. If overlapping keys are provided, template labels can diverge from spec.selector.matchLabels, which can break Deployment behavior. Render user labels first and selector labels last so selector keys remain authoritative.

Suggested change
     metadata:
       labels:
-{{ include "apk-helm.pod.selectorLabels" (dict "root" . "app" "idp-ui" ) | indent 8}}
 {{- with .Values.idp.idpui.deployment.pod.labels }}
 {{ toYaml . | indent 8 }}
 {{- end }}
+{{ include "apk-helm.pod.selectorLabels" (dict "root" . "app" "idp-ui" ) | indent 8}}
🤖 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-charts/templates/idp/idp-ui/idp-ui-deployment.yaml` around lines 34 -
36, The current template prints user pod labels
(.Values.idp.idpui.deployment.pod.labels) after the chart's selector labels
which allows users to override selector keys; change the template so user labels
are rendered first and the selector labels (the Deployment's
spec.selector.matchLabels keys) are rendered last so selector keys remain
authoritative. Locate the block that uses "{{- with
.Values.idp.idpui.deployment.pod.labels }} {{ toYaml . | indent 8 }} {{- end }}"
and move/merge it so it appears before the selector labels block (or ensure
selector labels are rendered after it), preserving indenting (indent 8) and YAML
formatting. Ensure no duplicate keys remain after reordering so
spec.selector.matchLabels and pod.metadata.labels stay consistent.

@thivindu thivindu merged commit c5f8e53 into wso2:1.x May 6, 2026
6 checks passed
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