Skip to content

feat(helm): gate OpenShift UI Route behind ui.route.enabled#2031

Merged
EItanya merged 4 commits into
kagent-dev:mainfrom
davidkarlsen:gate-openshift-ui-route
Jun 18, 2026
Merged

feat(helm): gate OpenShift UI Route behind ui.route.enabled#2031
EItanya merged 4 commits into
kagent-dev:mainfrom
davidkarlsen:gate-openshift-ui-route

Conversation

@davidkarlsen

Copy link
Copy Markdown
Contributor

Problem

The OpenShift Route for the kagent UI (helm/kagent/templates/openshift-route.yaml) renders unconditionally whenever the route.openshift.io/v1 API is present — the only guard is the CRD-existence check. There is no value to turn it off.

As raised in #2028, this means that on OpenShift the UI is effectively always exposed via an edge-terminated Route straight to kagent-ui:8080, with no auth in front. Users who want to front the UI with the bundled oauth2-proxy subchart, a custom Route, or their own ingress have no supported way to stop the chart from also publishing this unauthenticated Route.

Fix

  • Add a ui.route.enabled value (default true to preserve current behavior — existing OpenShift users must not silently lose the Route on upgrade).

  • AND it with the existing CRD-presence check, so the Route stays a no-op off-OpenShift and can now be disabled on OpenShift:

    {{- if and (.Capabilities.APIVersions.Has "route.openshift.io/v1") .Values.ui.route.enabled }}
    

No other behavior changes.

Verification (helm template)

Scenario kind: Route rendered
--api-versions route.openshift.io/v1 (default) ✅ present
--api-versions route.openshift.io/v1 --set ui.route.enabled=false ❌ absent
no --api-versions (CRD guard) ❌ absent

Fixes #2028

The OpenShift Route for the kagent UI rendered unconditionally whenever
the route.openshift.io/v1 API was present, with no way to disable it.
This left the UI exposed via an edge-terminated Route with no auth, even
when fronting it with the bundled oauth2-proxy or a custom ingress.

Add a `ui.route.enabled` value (default true to preserve behavior) and
AND it with the existing CRD-presence check so the Route can be turned
off while remaining a no-op off-OpenShift.

Fixes kagent-dev#2028

Signed-off-by: David J. M. Karlsen <david@davidkarlsen.com>
Copilot AI review requested due to automatic review settings June 16, 2026 21:02
@github-actions github-actions Bot added the enhancement New feature or request label Jun 16, 2026

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a Helm value flag to gate creation of an OpenShift Route for the UI, and wires that flag into the OpenShift Route template so it only renders when enabled and the API is available.

Changes:

  • Introduces ui.route.enabled in chart values (default true) with documentation.
  • Updates the OpenShift Route template to require both the OpenShift Route API and ui.route.enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
helm/kagent/values.yaml Adds ui.route.enabled configuration and documentation for gating the UI OpenShift Route.
helm/kagent/templates/openshift-route.yaml Gates rendering of the Route resource on both API availability and the new values flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helm/kagent/templates/openshift-route.yaml
Comment thread helm/kagent/values.yaml
@mesutoezdil

mesutoezdil commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

1 gap: there is no openshift-route_test.yaml in helm/kagent/tests/. A unit test covering the ui.route.enabled=false case (and ideally the enabled + API present case) would make the guard verifiable without a live cluster. The other files in that directory show the pattern.

@davidkarlsen

Copy link
Copy Markdown
Contributor Author

1 gap: there is no openshift-route_test.yaml in helm/kagent/tests/. A unit test covering the ui.route.enabled=false case (and ideally the enabled + API present case) would make the guard verifiable without a live cluster. The other files in that directory show the pattern.

thanks for the review - didn't realize there were tests there - added now!

@EItanya

EItanya commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Hey there @davidkarlsen, you will need to sign your commits to pass DCO, you can check the job for more info

David J. M. Karlsen and others added 2 commits June 18, 2026 10:02
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: David J. M. Karlsen <david.johan.macdonald.karlsen@dnb.no>
@davidkarlsen davidkarlsen force-pushed the gate-openshift-ui-route branch from 3acf187 to e788753 Compare June 18, 2026 08:13
@davidkarlsen

Copy link
Copy Markdown
Contributor Author

Hey there @davidkarlsen, you will need to sign your commits to pass DCO, you can check the job for more info

fixed

@EItanya EItanya merged commit 5a18873 into kagent-dev:main Jun 18, 2026
23 checks passed
@davidkarlsen davidkarlsen deleted the gate-openshift-ui-route branch June 18, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secure the kagent UI

4 participants