Skip to content

Add pod.labels support to all helm charts#174

Merged
kavindasr merged 3 commits into4.6.xfrom
copilot/add-pod-labels-annotations-selectors
Apr 10, 2026
Merged

Add pod.labels support to all helm charts#174
kavindasr merged 3 commits into4.6.xfrom
copilot/add-pod-labels-annotations-selectors

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

Purpose

Enable custom pod labels configuration in helm charts. Pod annotations and nodeSelector already exist, but pod labels were missing.

Goals

Add wso2.deployment.pod.labels configuration 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: {} to values.yaml and updated deployment templates to merge custom labels with default labels in all 5 charts:

  • distributed/gateway
  • distributed/control-plane (2 instances)
  • distributed/key-manager
  • distributed/traffic-manager (2 instances)
  • all-in-one (2 instances)

Implementation follows existing pod.annotations pattern for consistency.

Template changes:

labels:
  deployment: {{ template "chart.fullname" . }}
  product: apim
  {{- if .Values.wso2.deployment.pod.labels }}
  {{- toYaml .Values.wso2.deployment.pod.labels | nindent 8 }}
  {{- end }}

Usage example:

wso2:
  deployment:
    nodeSelector:
      disktype: ssd
    pod:
      annotations:
        prometheus.io/scrape: "true"
      labels:
        team: platform
        environment: production
        cost-center: engineering

User stories

  • As a platform engineer, I can add custom labels to pods for Prometheus service discovery
  • As a DevOps engineer, I can label pods for cost allocation and chargeback
  • As a security engineer, I can apply network policies based on pod labels

Release note

Added support for custom pod labels via wso2.deployment.pod.labels configuration in all helm charts.

Documentation

README.md files updated for all charts with wso2.deployment.pod.labels parameter documentation. No additional documentation needed.

Training

N/A - Configuration follows existing patterns for pod.annotations and nodeSelector.

Certification

N/A - Internal configuration option, does not affect product functionality or certification scope.

Marketing

N/A - Internal infrastructure improvement.

Automation tests

  • Unit tests: N/A (helm charts)
  • Integration tests: All charts validated with helm lint and test rendering with custom values

Security checks

Samples

N/A - Configuration is self-explanatory and documented in README files.

Related PRs

None

Migrations (if applicable)

N/A - Backward compatible. Default value is empty map {}, producing identical output to previous versions.

Test environment

  • Helm 3.x
  • Validated YAML rendering with custom and default values across all 5 charts

Learning

Analyzed existing pod.annotations implementation to maintain consistency. Verified helm template best practices for conditional YAML rendering with empty maps.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI and others added 2 commits March 19, 2026 04:33
Co-authored-by: tharindu1st <6345931+tharindu1st@users.noreply.github.com>
Co-authored-by: tharindu1st <6345931+tharindu1st@users.noreply.github.com>
Copilot AI changed the title [WIP] Add pod labels, pod annotations, and node selectors in helm charts Add pod.labels support to all helm charts Mar 19, 2026
Copilot AI requested a review from tharindu1st March 19, 2026 04:38
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@kavindasr kavindasr left a comment

Choose a reason for hiding this comment

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

Update default values yamls in docs/

Please fix this @copilot

@kavindasr kavindasr marked this pull request as ready for review April 9, 2026 09:22
@kavindasr kavindasr merged commit 43aacc6 into 4.6.x Apr 10, 2026
1 check was pending
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.

5 participants