Skip to content

[INFRA-413] fix(plane-enterprise): decouple ingress controller type from class name#255

Open
pratapalakshmi wants to merge 3 commits into
masterfrom
fix/ingress-controller-class-decoupling
Open

[INFRA-413] fix(plane-enterprise): decouple ingress controller type from class name#255
pratapalakshmi wants to merge 3 commits into
masterfrom
fix/ingress-controller-class-decoupling

Conversation

@pratapalakshmi

@pratapalakshmi pratapalakshmi commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What

Decouples the ingress controller type (which resource kind to render) from the ingress class name in plane-enterprise, via a new ingress.controller value.

  • templates/_helpers.tpl — new plane.ingressController helper. Only controller: traefik selects the Traefik IngressRoute; any other value selects the standard networking.k8s.io/v1 Ingress. Empty falls back to the previous auto-detect from ingressClass.
  • templates/ingress.yaml — gate changed from eq .Values.ingress.ingressClass "nginx" to eq (include "plane.ingressController" .) "ingress". Also fixed a pre-existing nil-pointer render error.
  • templates/ingress-traefik.yaml — gate changed from hasPrefix "traefik" .Values.ingress.ingressClass to eq (include "plane.ingressController" .) "traefik".
  • values.yaml — added documented ingress.controller: ''; clarified ingressClass is now just spec.ingressClassName.
  • README.md — rewrote the controller-selection section and values tables.
  • Chart.yamlversion 2.6.2 → 2.6.3 (appVersion unchanged).

Key gate change:

- {{- if and .Values.ingress.enabled (eq .Values.ingress.ingressClass "nginx") .Values.license.licenseDomain }}
+ {{- if and .Values.ingress.enabled (eq (include "plane.ingressController" .) "ingress") .Values.license.licenseDomain }}

Why

ingress.ingressClass was overloaded to pick both the resource kind and the class-name string. The standard Ingress rendered only for the exact value nginx, so a standard controller using a non-standard class name like nginx-new (e.g. F5 NGINX) got no ingress at all, with no error and no resource — undocumented, silent behavior. Operators had to hand-roll a custom ingress and keep its routes in sync manually.

ingress.controller lets operators state the controller type explicitly while using any class name their controller exposes. This also aligns the templates with what the README already claimed ("any value other than traefik → standard Ingress"), which the code never actually did.

Separately, templates/ingress.yaml had a latent bug: gt (len .Values.ingress.ingress_annotations) 0 throws len of nil pointer when ingress_annotations is unset. It was rarely hit while the path was gated to nginx; making the standard path broadly reachable would expose it. Switched to {{- with .Values.ingress.ingress_annotations }}.

Scope / behavior

  • Backward compatible. ingress.controller defaults to ''. When empty, the controller is auto-detected from ingressClass using the prior rule (starts with traefik → Traefik, else standard Ingress). Existing values files render the same resource as before.
  • controller: traefik → Traefik IngressRoute. Any other non-empty value (nginx, f5, haproxy, ...) → standard Ingress. The value is only a selector; the actual class name still comes from ingress.ingressClass.
  • Use controller to override auto-detect — e.g. a class name like nginx-new.
  • ingress.ingress_annotations render only on the standard Ingress; ignored when the controller resolves to Traefik (unchanged).
  • No changes to host mapping (license.licenseDomain), TLS (ssl.*), or any non-ingress template.

Testing

helm lint clean; helm template verified for each combination:

Scenario Values Rendered
Default ingressClass: traefik IngressRoute
Non-standard nginx class ingressClass: nginx-new (no controller) Ingress, ingressClassName: nginx-new
nginx-new, no annotations as above, ingress_annotations unset Ingress renders (no nil-pointer error)
Explicit Traefik override controller: traefik, ingressClass: whatever IngressRoute
Full-chart default render license.licenseDomain set clean, no errors

Upgrade notes

No action required for existing installs (auto-detect preserves prior behavior). Operators with atypical class names can now set ingress.controller instead of maintaining a hand-rolled ingress.

🤖 Generated with Claude Code

The ingress templates used `ingress.ingressClass` to decide both the
resource kind (standard Ingress vs Traefik IngressRoute) and the class
name string. As a result `ingress.yaml` rendered only for the exact
value `nginx` and `ingress-traefik.yaml` only for values prefixed
`traefik` — any other class name (a Traefik alias, or `nginx-new`)
matched neither template and the ingress was silently dropped.

Introduce `ingress.controller` to select the resource kind, decoupled
from the free-form class name. Only `traefik` selects the IngressRoute;
any other value selects a standard Ingress. Empty falls back to the
previous auto-detection from `ingressClass`, so existing installs are
unaffected.

Also fix a pre-existing latent bug in ingress.yaml where `len` of a nil
`ingress_annotations` threw a hard render error; switched to `with`.

Bumps chart 2.6.2 -> 2.6.3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The chart introduces a new ingress.controller value and a corresponding plane.ingressController Helm helper that resolves the effective controller type (traefik or ingress) from an explicit value or by inferring it from the ingress.ingressClass prefix. Both ingress templates now gate on this helper's output. Values comments, README migration docs, and the chart version (2.6.2 → 2.6.3) are updated to match.

Changes

ingress.controller Selector for Traefik vs Standard Ingress

Layer / File(s) Summary
plane.ingressController helper and template gate conditions
charts/plane-enterprise/templates/_helpers.tpl, charts/plane-enterprise/templates/ingress-traefik.yaml, charts/plane-enterprise/templates/ingress.yaml
Adds the plane.ingressController helper that returns traefik or ingress by checking an explicit ingress.controller value (lowercased/trimmed) or falling back to a traefik prefix check on ingress.ingressClass. Both ingress templates replace their direct ingressClass conditionals with calls to this helper; the standard ingress template also switches annotation inclusion from a length check to a with block.
Values comments, README docs, and chart version bump
charts/plane-enterprise/values.yaml, charts/plane-enterprise/README.md, charts/plane-enterprise/Chart.yaml
Replaces ingressClass-centric comments in values.yaml with a description of the controller/ingressClass split and Traefik-specific annotation guidance. Updates README migration sections, the template-selection table, advanced-setup required values list, and the Ingress/SSL configuration table to document ingress.controller and its auto-detection behavior. Bumps chart version to 2.6.3.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mguptahub
  • pablohashescobar

Poem

🐇 A hop through the ingress, a twitch of the ear,
controller now guides which template appears.
No more prefix-guessing from class names alone—
Traefik or standard, the helper has known.
The rabbit stamps 2.6.3 with a cheer! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and specifically describes the main change: decoupling ingress controller type from class name in the plane-enterprise Helm chart, which directly addresses the core objective of the PR.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ingress-controller-class-decoupling

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.

The ingress.controller feature stays (it implements the F5/nginx-new
request). Remove only the README/values examples about serving a
Traefik-named class alias via a standard Ingress, which is no longer a
needed use case.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charts/plane-enterprise/templates/ingress-traefik.yaml`:
- Line 1: The gate condition mismatch between ingress-traefik.yaml and
traefik-middleware.yaml causes the Middleware resource to fail rendering when
the IngressRoute succeeds. In traefik-middleware.yaml, replace the current gate
condition that uses hasPrefix with .Values.ingress.ingressClass with the same
condition used in ingress-traefik.yaml, which checks eq (include
"plane.ingressController" .) "traefik". This ensures both resources use the same
logic to determine when to render, preventing route admission failures due to
missing Middleware definitions.

In `@charts/plane-enterprise/values.yaml`:
- Around line 41-57: The ingress.ingressClass field has conflicting default
values between values.yaml and questions.yml. In values.yaml, the controller
field is set to an empty string while ingressClass is set to 'traefik', but
questions.yml specifies a different default. Update the default value in either
values.yaml or questions.yml to ensure consistency, so that the
ingress.ingressClass field has a single authoritative default value across both
configuration sources. Choose the default value that aligns with your intended
ingress controller behavior and ensure both files reflect the same default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dbec525f-2c8f-4840-bd79-e0e204816478

📥 Commits

Reviewing files that changed from the base of the PR and between f38dfca and d9c9c6e.

📒 Files selected for processing (6)
  • charts/plane-enterprise/Chart.yaml
  • charts/plane-enterprise/README.md
  • charts/plane-enterprise/templates/_helpers.tpl
  • charts/plane-enterprise/templates/ingress-traefik.yaml
  • charts/plane-enterprise/templates/ingress.yaml
  • charts/plane-enterprise/values.yaml

Comment thread charts/plane-enterprise/templates/ingress-traefik.yaml
Comment thread charts/plane-enterprise/values.yaml
- traefik-middleware.yaml: gate on plane.ingressController (matching
  ingress-traefik.yaml) instead of hasPrefix on ingressClass. Prevents a
  missing Middleware (and route admission failure) when controller=traefik
  with a non-traefik ingressClass, and avoids an orphan Middleware in the
  reverse case.
- questions.yml: default ingress.ingressClass to "traefik" to match
  values.yaml (the authoritative chart default).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pratapalakshmi pratapalakshmi changed the title fix(plane-enterprise): decouple ingress controller type from class name [INFRA-413] fix(plane-enterprise): decouple ingress controller type from class name 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.

1 participant