Skip to content

[INFRA-424] - feat(plane-enterprise): add standard Kubernetes recommended labels#256

Open
sriramveeraghanta wants to merge 3 commits into
masterfrom
feat/standard-helm-labels
Open

[INFRA-424] - feat(plane-enterprise): add standard Kubernetes recommended labels#256
sriramveeraghanta wants to merge 3 commits into
masterfrom
feat/standard-helm-labels

Conversation

@sriramveeraghanta

@sriramveeraghanta sriramveeraghanta commented Jun 23, 2026

Copy link
Copy Markdown
Member

What

Adds the standard Helm/Kubernetes recommended labels to every resource rendered by plane-ce and plane-enterprise:

labels:
  helm.sh/chart: plane-ce-1.5.1
  app.kubernetes.io/name: plane-ce
  app.kubernetes.io/instance: <release-name>
  app.kubernetes.io/managed-by: Helm
  app.kubernetes.io/version: "1.3.1"

Implementation is centralized in templates/_helpers.tpl (both charts):

  • New plane.chart and plane.commonLabels helpers.
  • plane.labelsAndAnnotations refactored to always emit the common labels and still merge any per-component labels/annotations. It now takes the root context plus the component values:
    {{- include "plane.labelsAndAnnotations" (dict "context" $ "values" .Values.api) }}
    
  • plane.commonLabels is also applied inline to every other resource's metadata.labels (Services, ServiceAccounts, ConfigMaps, Secrets, Ingress, IngressRoutes, Middleware, Certificates, Issuers) and to every Deployment/StatefulSet/Job pod template.

Why

Resolves #135. The charts previously emitted only a custom app.name label, so resources carried none of the standard app.kubernetes.io/* / helm.sh/chart labels that tooling relies on (e.g. kubectl get all -l app.kubernetes.io/instance=<release>, ArgoCD/Flux ownership, cost/inventory dashboards, helm-aware cleanup).

Scope / behavior

  • Purely additive to rendered output. The existing app.name label and all spec.selector / spec.selector.matchLabels are left byte-for-byte unchanged.
  • Upgrade-safe. Because selectors are untouched, helm upgrade of an existing release never attempts to mutate an immutable spec.selector. New labels land on metadata.labels (mutable) and pod templates (Deployment/StatefulSet templates are mutable; the migrator/minio-bucket Jobs are already recreated each upgrade via a revision/timestamp suffix in their name).
  • No Chart.yaml version bump — versioning is handled in your dedicated release PRs / manual workflow_dispatch, so this leaves it to you.
  • Labels render correctly for conditionally-gated resources (certs, ingress variants, pi-* services, email, GCS vs bundled MinIO).

Testing

All via helm 3.18, both charts:

  • helm lint charts/plane-ce and charts/plane-enterprise0 failures.
  • Diff of helm template before vs after: every changed line is an added standard-label line (or a labels: key). Zero lines removed or modified → selectors, app.name, and all existing content are identical.
  • Completeness across 10 value scenarios (defaults; external DBs / local_setup=false; traefik + cert-manager; nginx ingress; pi+email enabled; storage_provider=GCS; securityContext.enabled; airgapped.enabled): every rendered resource carries the standard labels at its top-level metadata.labels.
  • No duplicate labels: keys; all rendered documents parse as valid YAML.

Example (StatefulSet — selector untouched, labels added):

metadata:
  name: ce-pgdb-wl
  labels:
    helm.sh/chart: plane-ce-1.5.1
    app.kubernetes.io/name: plane-ce
    app.kubernetes.io/instance: ce
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/version: "1.3.1"
spec:
  selector:
    matchLabels:
      app.name: default-ce-pgdb   # unchanged

Related

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Standardized Kubernetes labels across charts and workloads for better consistency.
    • Added shared labels to services, deployments, jobs, stateful sets, ingresses, certificates, secrets, config maps, and service accounts.
  • Bug Fixes

    • Improved label and annotation rendering so resources now inherit chart-level labels more reliably.
  • Chores

    • Updated the chart version to 2.7.0.

Adds the standard Helm/Kubernetes recommended labels to every resource
rendered by the plane-ce and plane-enterprise charts, addressing #135:

  helm.sh/chart
  app.kubernetes.io/name
  app.kubernetes.io/instance
  app.kubernetes.io/managed-by
  app.kubernetes.io/version

Implementation:
- New _helpers.tpl helpers "plane.chart" and "plane.commonLabels";
  "plane.labelsAndAnnotations" refactored to emit the common labels and
  still merge any per-component labels/annotations (now called with
  (dict "context" $ "values" .Values.<component>)).
- Common labels applied to every resource's metadata.labels (workloads,
  Services, ServiceAccounts, ConfigMaps, Secrets, Ingress, IngressRoutes,
  Middleware, Certificates, Issuers) and to Deployment/StatefulSet/Job
  pod templates.

The existing custom "app.name" label and all spec.selector/matchLabels
are intentionally left unchanged so that helm upgrade of an existing
release never attempts to mutate an immutable selector. The change is
purely additive to rendered output.

Closes #135

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d326c0ee-b770-428a-9516-57b1a02619dc

📥 Commits

Reviewing files that changed from the base of the PR and between edb44b1 and f0489ce.

📒 Files selected for processing (2)
  • charts/plane-enterprise/Chart.yaml
  • charts/plane-enterprise/templates/config-secrets/pi-api-env.yaml
✅ Files skipped from review due to trivial changes (1)
  • charts/plane-enterprise/Chart.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • charts/plane-enterprise/templates/config-secrets/pi-api-env.yaml

Walkthrough

The plane-enterprise Helm chart gains two new helper templates (plane.chart and plane.commonLabels) that emit standard Kubernetes recommended labels (helm.sh/chart, app.kubernetes.io/*). The plane.labelsAndAnnotations helper is rewritten to accept a {context, values} dict. All resource templates (Secrets, ConfigMaps, Certificates, Ingress, ServiceAccount, Middleware, and all workload Deployments/StatefulSets/Jobs) are updated to emit these common labels. The chart version is bumped to 2.7.0.

Changes

Standard Kubernetes Recommended Labels

Layer / File(s) Summary
Helper templates: plane.chart, plane.commonLabels, plane.labelsAndAnnotations
charts/plane-enterprise/templates/_helpers.tpl
Adds plane.chart (sanitized helm.sh/chart value) and plane.commonLabels (standard app.kubernetes.io/* labels). Rewrites plane.labelsAndAnnotations to accept a dict with context and values keys, always emitting plane.commonLabels before merging per-component labels/annotations.
Non-workload resource labeling
charts/plane-enterprise/templates/certs/*, charts/plane-enterprise/templates/config-secrets/*, charts/plane-enterprise/templates/ingress*.yaml, charts/plane-enterprise/templates/service-account.yaml, charts/plane-enterprise/templates/traefik-middleware.yaml
Adds metadata.labels blocks populated via plane.commonLabels to all Secrets, ConfigMaps, cert-manager Certificates and Issuers, Ingress, IngressRoute, ServiceAccount, and Traefik Middleware resources.
Workload labeling and call-site updates
charts/plane-enterprise/templates/workloads/*.yaml
Updates all Deployment, StatefulSet, and Job templates to inject plane.commonLabels into Service metadata labels and pod template metadata labels, and switches all plane.labelsAndAnnotations calls from passing values directly to passing dict "context" $ "values" <component-values>.
Chart version bump
charts/plane-enterprise/Chart.yaml
Bumps chart version from 2.6.2 to 2.7.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mguptahub

Poem

🐇 Hop hop, labels now bloom,
On every resource they loom!
helm.sh/chart shines bright,
app.kubernetes.io just right,
The rabbit stamps all with care —
Standard labels everywhere! 🏷️

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: adding standard Kubernetes recommended labels to plane-enterprise.
Linked Issues check ✅ Passed The PR adds the requested standard Helm/Kubernetes labels, including helm.sh/chart, app.kubernetes.io/version, and app.kubernetes.io/managed-by.
Out of Scope Changes check ✅ Passed Changes stay focused on chart labeling and the necessary helper refactor, with only a version bump as supporting metadata.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/standard-helm-labels

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.

…chart to 2.7.0

Standard-labels for the community chart moved to its own PR (#257). This PR is
now plane-enterprise only. Bumps plane-enterprise chart 2.6.1 -> 2.7.0.
@akshat5302 akshat5302 changed the title feat: add standard Kubernetes recommended labels to chart resources [INFRA-424] - feat(plane-enterprise): add standard Kubernetes recommended labels Jun 23, 2026
@makeplane

makeplane Bot commented Jun 23, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

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.

Standard helm labels Missing

3 participants