Skip to content

[INFRA-438] - feat(plane-ce): configurable labels & annotations for all resources, pods, and one-shot jobs#263

Open
akshat5302 wants to merge 1 commit into
masterfrom
feat/plane-ce-configurable-labels
Open

[INFRA-438] - feat(plane-ce): configurable labels & annotations for all resources, pods, and one-shot jobs#263
akshat5302 wants to merge 1 commit into
masterfrom
feat/plane-ce-configurable-labels

Conversation

@akshat5302

Copy link
Copy Markdown
Member

What

Community-chart counterpart of #262. Makes labels/annotations user-configurable across the entire plane-ce chart, layered on top of the standard recommended labels from #257. Adds to values.yaml (plane-ce uses flat component keys):

commonLabels: {}          # every object + every pod template
commonAnnotations: {}
api:
  labels: {}              # (pre-existing) that workload's object metadata
  annotations: {}
  podLabels: {}           # NEW: that workload's pod template only
  podAnnotations: {}
  migrator:               # NEW: override tier for the one-shot migration Job
    labels: {}
    annotations: {}
    podLabels: {}
    podAnnotations: {}
minio:
  bucketJob: {...}        # same override tier for the bucket-setup Job

Precedence on key conflict: job override > per-component > common > standard labels. All chart objects (Deployments, StatefulSets, Jobs, Services, ConfigMaps, Secrets, certs, Ingress/IngressRoute, ServiceAccount, Middleware) and all 12 pod templates are wired through shared helpers in templates/_helpers.tpl, for all 11 components.

Why

  • Pod-level metadata is what runtime tooling matches on: NetworkPolicy/Cilium podSelector, service-mesh injection, Prometheus scrape annotations, Vault agent injection. The chart previously exposed only object-level <component>.labels, so none of these integrations could target Plane pods.
  • Chart-wide commonLabels/commonAnnotations (Grafana/GitLab convention) enable cost-allocation, ownership, and GitOps grouping without repeating maps per component.
  • The job override tier solves the meshed-cluster failure: sidecar.istio.io/inject: "true" on api pods would be inherited by the migration Job, whose sidecar never exits, so the Job never completes. Jobs inherit the parent component's maps and selectively override (inject: "false"), and can take Job-only object annotations like argocd.argoproj.io/hook: PreSync.

Scope / behavior

  • Default behavior unchanged: all new values default to {}; with defaults the rendered output is identical to master except the two bug-fixes below.
  • helm upgrade safe: nothing is ever injected into spec.selector/matchLabels — selectors stay on the immutable app.name label. Verified all 20 selectors byte-identical between unlabeled and fully-labeled renders.
  • The nginx Ingress merges commonAnnotations with the existing ingress.ingress_annotations (ingress-specific wins). Traefik IngressRoutes/Middleware get the common maps too.
  • Helper rename (internal only): plane.commonLabels ([INFRA-423] - feat(plane-ce): add standard Kubernetes recommended labels #257) → plane.standardLabels, freeing the "common" name for the user-facing values key; new plane.resourceLabels/plane.resourceAnnotations/plane.podLabels/plane.podAnnotations compose the tiers.

Bug fixes (found while testing)

  1. MinIO bucket Job pod template had no labels at all (missed in [INFRA-423] - feat(plane-ce): add standard Kubernetes recommended labels #257 as well) — now carries standard + configured labels like every other pod.
  2. Traefik Middleware rendered maxRequestBodyBytes: 2.097152e+07 (Helm float64 scientific notation), which the CRD's integer field can reject — now | int64, renders 20971520.

Testing

  • helm lint clean; chart version bumped 1.6.0 → 1.7.0.
  • 5-scenario render-assertion suite (~1,500 programmatic assertions via helm template + YAML parsing): defaults (standard labels everywhere, zero leak), full combo (common + per-component + precedence conflicts: postgres.podLabels.team beats commonLabels.team; migrator overrides istio inject while inheriting prometheus annotations; ArgoCD hook on Job object only; bucket Job pod labels), nginx ingress annotation merge conflict, standard-label override escape hatch, special-character values (JSON/unicode/URLs/numeric strings stay strings).
  • Selector-immutability check: 20 shared selectors identical across unlabeled vs fully-labeled renders.

Upgrade notes

None required. Existing releases upgrade in place; new labels/annotations only appear if the operator sets the new values.

Related

🤖 Generated with Claude Code

…ds, and one-shot jobs

Community-chart counterpart of the plane-enterprise change (#262). Adds a
three-tier (plus job-override) configurable metadata scheme on top of the
standard recommended labels from #257, following the Grafana/GitLab chart
conventions:

- commonLabels / commonAnnotations: chart-wide, applied to every object the
  chart renders (Deployments, StatefulSets, Jobs, Services, ConfigMaps,
  Secrets, certs, Ingress/IngressRoute, ServiceAccount, Middleware) and to
  every pod template.
- <component>.labels / annotations: one workload's object metadata
  (pre-existing keys, now merged with the common tier).
- <component>.podLabels / podAnnotations: one workload's pod template only -
  what NetworkPolicies, service meshes and Prometheus match on. Added for
  all 11 components (plane-ce values are flat: api.podLabels).
- api.migrator / minio.bucketJob: override tier for the one-shot Jobs. Jobs
  inherit their parent component's maps; keys set here win on conflict
  (e.g. sidecar.istio.io/inject "false" so migration Jobs complete on
  meshed clusters, or ArgoCD hook annotations on the Job object only).

Precedence: job override > per-component > common > standard labels.
Nothing is ever injected into spec.selector/matchLabels, so helm upgrade
of an existing release never trips the immutable-selector error.

Helpers: plane.commonLabels (from #257) renamed to plane.standardLabels to
free the "common" name for the user-facing values key (GitLab's naming);
new plane.resourceLabels / plane.resourceAnnotations / plane.podLabels /
plane.podAnnotations compose the tiers; plane.labelsAndAnnotations extended
with the common + job tiers.

Also fixes, found while testing:
- MinIO bucket Job pod template had no labels at all (missed in #257 too).
- Traefik Middleware maxRequestBodyBytes rendered as scientific notation
  (2.097152e+07), which the CRD's integer field can reject - now | int64.

Validated with helm lint and a 5-scenario render-assertion suite
(~1,500 assertions) plus a selector-immutability check between unlabeled
and fully-labeled renders.

Chart version: 1.6.0 -> 1.7.0.
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@akshat5302, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9cfdf4e1-b5b6-4305-95f9-d00353568d3c

📥 Commits

Reviewing files that changed from the base of the PR and between 6014e5f and 47851fe.

📒 Files selected for processing (28)
  • charts/plane-ce/Chart.yaml
  • charts/plane-ce/README.md
  • charts/plane-ce/templates/_helpers.tpl
  • charts/plane-ce/templates/certs/cert-issuers.yaml
  • charts/plane-ce/templates/certs/certs.yaml
  • charts/plane-ce/templates/config-secrets/app-env.yaml
  • charts/plane-ce/templates/config-secrets/doc-store.yaml
  • charts/plane-ce/templates/config-secrets/docker-registry.yaml
  • charts/plane-ce/templates/config-secrets/live-env.yaml
  • charts/plane-ce/templates/config-secrets/pgdb.yaml
  • charts/plane-ce/templates/config-secrets/rabbitmqdb.yaml
  • charts/plane-ce/templates/ingress-traefik.yaml
  • charts/plane-ce/templates/ingress.yaml
  • charts/plane-ce/templates/service-account.yaml
  • charts/plane-ce/templates/traefik-middleware.yaml
  • charts/plane-ce/templates/workloads/admin.deployment.yaml
  • charts/plane-ce/templates/workloads/api.deployment.yaml
  • charts/plane-ce/templates/workloads/beat-worker.deployment.yaml
  • charts/plane-ce/templates/workloads/live.deployment.yaml
  • charts/plane-ce/templates/workloads/migrator.job.yaml
  • charts/plane-ce/templates/workloads/minio.stateful.yaml
  • charts/plane-ce/templates/workloads/postgres.stateful.yaml
  • charts/plane-ce/templates/workloads/rabbitmq.stateful.yaml
  • charts/plane-ce/templates/workloads/redis.stateful.yaml
  • charts/plane-ce/templates/workloads/space.deployment.yaml
  • charts/plane-ce/templates/workloads/web.deployment.yaml
  • charts/plane-ce/templates/workloads/worker.deployment.yaml
  • charts/plane-ce/values.yaml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/plane-ce-configurable-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.

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.

1 participant