Skip to content

[helm-dashboard] Add commonLabels support - #730

Closed
ashutoshbhardwaj007 wants to merge 1 commit into
komodorio:mainfrom
ashutoshbhardwaj007:patch-1
Closed

[helm-dashboard] Add commonLabels support#730
ashutoshbhardwaj007 wants to merge 1 commit into
komodorio:mainfrom
ashutoshbhardwaj007:patch-1

Conversation

@ashutoshbhardwaj007

Copy link
Copy Markdown
Contributor

What this PR does

Adds commonLabels support to the helm-dashboard chart, allowing users to define a set of labels that are applied to all chart-managed resources.

Why

Teams running helm-dashboard in shared or multi-tenant clusters commonly need to attach labels to all resources for:

  • Cost allocation and chargeback (e.g. team:, env:, cost-center:)
  • Network policy targeting
  • Label-based selectors and queries (e.g. in Prometheus, Grafana, kubectl)
  • Compliance and audit requirements

Currently the chart only supports labels on the PersistentVolumeClaim (dashboard.persistence.labels). There is no way to label the Deployment, Service, ServiceAccount, Ingress, or pod template without forking the chart.

Changes

  • Add commonLabels: {} to values.yaml
  • Apply the helper to all chart-managed resources:
    • Deployment (metadata + pod template)
    • Service
    • ServiceAccount
    • Ingress

Usage

commonLabels:
  team: platform
  env: production
  cost-center: infra

References

## What this PR does

Adds `commonLabels` support to the helm-dashboard chart, allowing users
to define a set of labels that are applied to all chart-managed resources.

## Why

Teams running helm-dashboard in shared or multi-tenant clusters commonly
need to attach labels to all resources for:

- Cost allocation and chargeback (e.g. `team:`, `env:`, `cost-center:`)
- Network policy targeting
- Label-based selectors and queries (e.g. in Prometheus, Grafana, kubectl)
- Compliance and audit requirements

Currently the chart only supports labels on the PersistentVolumeClaim
(`dashboard.persistence.labels`). There is no way to label the
Deployment, Service, ServiceAccount, Ingress, or pod template without
forking the chart.

## Changes

- Add `commonLabels: {}` to `values.yaml`
- Apply the helper to all chart-managed resources:
  - Deployment (metadata + pod template)
  - Service
  - ServiceAccount
  - Ingress

## Usage

```yaml
commonLabels:
  team: platform
  env: production
  cost-center: infra
```

## References

- Similar implementation in prometheus-community charts:
  prometheus-community/helm-charts#6608
@undera

undera commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Have you tested that it does what you claim?

@undera

undera commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Answering my own question above: the change as submitted is a no-op. commonLabels is only declared in values.yaml — no template reads it, so no resource actually gets labelled. dashboard.persistence.labels, referenced in the description, is dead in exactly the same way.

I opened #739, which carries your commit and adds the templating: the value is merged into the helm-dashboard.labels helper that every resource already includes, plus the Deployment pod template — kept out of spec.selector.matchLabels, which is immutable and would break helm upgrade on existing releases. It also wires up dashboard.persistence.labels and adds the README rows.

Thanks for raising it.

@undera undera closed this in #739 Aug 10, 2026
pull Bot pushed a commit to bhardwajRahul/helm-dashboard that referenced this pull request Aug 10, 2026
)

Applies commonLabels to every rendered resource, wires up the likewise-unused dashboard.persistence.labels, and adds the missing README rows.

Closes komodorio#730

Co-authored-by: ashutoshbhardwaj007 <ashutosh.bhardwaj@poppulo.com>
@ashutoshbhardwaj007

Copy link
Copy Markdown
Contributor Author

Thanks @undera

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.

2 participants