Skip to content

feat(helm): add commonLabels support to helm chart#8078

Merged
arkodg merged 2 commits intoenvoyproxy:mainfrom
gaganhr94:feat/add-commonlabels
Feb 8, 2026
Merged

feat(helm): add commonLabels support to helm chart#8078
arkodg merged 2 commits intoenvoyproxy:mainfrom
gaganhr94:feat/add-commonlabels

Conversation

@gaganhr94
Copy link
Copy Markdown
Contributor

What type of PR is this?

feat(helm): add commonLabels support to gateway-helm chart

What this PR does / why we need it:

Adds support for commonLabels in the gateway-helm chart, allowing users to apply custom labels to all resources managed by the chart. This is useful for:

  • Organizational tagging and resource tracking
  • Cost allocation and billing
  • Policy enforcement (e.g., Kyverno policies requiring specific labels)

The commonLabels field is now available at the root level of values.yaml and is added to Kubernetes resources through the eg.labels helper template.

Which issue(s) this PR fixes:

Fixes #7913

@gaganhr94 gaganhr94 requested a review from a team as a code owner January 27, 2026 15:44
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 27, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit a15dd88
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69878dd89c960f00084d8f52
😎 Deploy Preview https://deploy-preview-8078--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gaganhr94 gaganhr94 force-pushed the feat/add-commonlabels branch 2 times, most recently from 51198a4 to 26472bd Compare January 27, 2026 15:46
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.79%. Comparing base (fbea4a7) to head (a15dd88).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8078      +/-   ##
==========================================
- Coverage   73.80%   73.79%   -0.01%     
==========================================
  Files         241      241              
  Lines       36579    36579              
==========================================
- Hits        26997    26994       -3     
- Misses       7677     7679       +2     
- Partials     1905     1906       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gaganhr94 gaganhr94 force-pushed the feat/add-commonlabels branch from 26472bd to 73d7a3e Compare January 28, 2026 06:42
@gaganhr94
Copy link
Copy Markdown
Contributor Author

@arkodg @zirain can you please review this PR and share your thoughts about it. Currently the E2E tests are failing, but they don't look to be directly related to the changes made in this PR

@zirain zirain force-pushed the feat/add-commonlabels branch from 73d7a3e to 97f3f17 Compare January 28, 2026 22:31
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.commonLabels }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what would happen if there're same keys in eg.selectorLabels and commonLabels?

can you add a test case under test/helm/gatewa-helm?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the same keys are present in eg.selectorLabels and commonLabels, then the commonLabels value would override. This is an expected behaviour. The same pattern is followed in several bitnami charts and CNCF projects.

I've added the test for this change

Copy link
Copy Markdown
Member

@zirain zirain Jan 30, 2026

Choose a reason for hiding this comment

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

can you make CI happy?

rebase with main branch, run make gen-check and commit the changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done @zirain

@gaganhr94 gaganhr94 force-pushed the feat/add-commonlabels branch from 97f3f17 to 25604bc Compare January 29, 2026 16:31
@gaganhr94 gaganhr94 requested a review from zirain January 29, 2026 16:33
@arkodg arkodg added this to the Backlog milestone Jan 30, 2026
@arkodg arkodg requested review from a team January 30, 2026 01:34
@gaganhr94 gaganhr94 force-pushed the feat/add-commonlabels branch 4 times, most recently from d05673f to 2ad80f8 Compare January 30, 2026 12:08
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you improve these test base on https://github.com/envoyproxy/gateway/pull/8078/changes#r2742524657?
add comment for the override logic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@zirain, I have added the selectorLabel which will override the default one in the testcase. Just to be clear, in the generated YAML, you will see both the labels - the default one and the one added in commonLabels. When the YAML parser processes the file, it makes sure to consider the value in commonLabels.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

it there any tpl in helm to avoid this? or let's comment this behvior in the common-labels.in.yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I've commented this behaviour in common-labels.in.yaml clearly now. There are ways in which we can avoid the duplicates. But it is not generally not a pattern followed well known helm-charts, as it makes the _helpers.tpl complex.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, will merge this after 1.7.0 released to make RM's work easier.

@gaganhr94 gaganhr94 force-pushed the feat/add-commonlabels branch 3 times, most recently from 7dd7539 to 48663f2 Compare January 31, 2026 03:48
@gaganhr94 gaganhr94 requested a review from zirain January 31, 2026 03:51
Signed-off-by: Gagan H R <ghr@guidewire.com>
@gaganhr94 gaganhr94 force-pushed the feat/add-commonlabels branch from 48663f2 to f16728c Compare January 31, 2026 03:53
@jukie jukie requested review from a team February 7, 2026 19:09
@arkodg arkodg merged commit 6442347 into envoyproxy:main Feb 8, 2026
36 of 37 checks passed
Inode1 pushed a commit to Inode1/gateway that referenced this pull request Feb 23, 2026
feat: adds support for commonlabels

Signed-off-by: Gagan H R <ghr@guidewire.com>
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.

Add commonLabels support to Helm Chart

4 participants