Skip to content

[3509] - Treat the UI as an optional client of the 1.x platform - #3527

Open
asivanadi0 wants to merge 3 commits into
kagent-dev:mainfrom
asivanadi0:feat/3509-ui-enabled-toggle
Open

asivanadi0 wants to merge 3 commits into
kagent-dev:mainfrom
asivanadi0:feat/3509-ui-enabled-toggle

Conversation

@asivanadi0

@asivanadi0 asivanadi0 commented Nov 4, 2026 •

Copy link
Copy Markdown

Adds a top level ui.enabled value to the kagent chart so you can turn the UI off. Refs #3509

What changes

  • ui.enabled defaults to true so existing installs render the same manifests as main, no UI pod restart on upgrade.
  • with ui.enabled=false the chart skips the UI Deployment, Service, ServiceAccount and both configmaps (ui config + nginx). UI PDB, HTTPRoute and the OpenShift Route are skipped too, even if their own flags are on
  • NOTES drop the UI access steps, the UI line under deployed components and the UI PDB check when its off, and just print a short "UI: disabled" line instead.

Testing

  • added helm unittest cases - default still renders the UI deployment, ui.enabled=false renders nothing UI related even with PDB/HTTPRoute turned on, and NOTES on/off. make helm-test passes
  • ran helm lint and helm template with the flag on and off
  • haven't tried it on a live cluster yet

Known follow ups (not in this PR)

  • kagent dashboard always port-forwards to service/kagent-ui so it'll error out when the UI is disabled
  • controller still injects KAGENT_UI_URL into agents if ui.externalUrl is set, even with UI off
  • push issuer still falls back to ui.externalUrl
  • oauth2-proxy defaults UPSTREAM_URL to http://kagent-ui:8080 which wont have anything behind it when the UI is disabled

This might overlap with #3430 (moves UI serving into the controller). happy to rename the value if that lands so it still makes sense.

Test Results

Check Command Result
Helm unit tests make helm-test 351/351 passed, 33/33 suites (includes 2 new suites: ui-enabled_test.yaml, ui-enabled-notes_test.yaml)
Lint, default values helm lint helm/kagent Pass
Lint, UI disabled helm lint helm/kagent --set ui.enabled=false Pass
Default render vs main helm template diff against main Byte-identical (1,165 lines, 25 objects)
Render with UI disabled helm template --set ui.enabled=false 855 lines, 20 objects; UI Deployment, Service, ServiceAccount and both UI ConfigMaps removed
UI disabled, sub-toggles forced on --set ui.enabled=false with ui.pdb.enabled, ui.httpRoute.enabled, ui.route.enabled set to true 0 UI objects rendered
Cluster install n/a Not run (no cluster)
Go / CLI n/a Not changed, not tested

Disclamer

AI assisted with implementing the helm changes and unit tests in this PR, including running the validation of the tests as well!

Signed-off-by: Anpoo Sivanadi <sivanadi08@gmail.com>
@jayunit100

jayunit100 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

kagent dashboard still assumes service/kagent-ui, and KAGENT_UI_URL + the push issuer still read from ui.externalUrl

Just saw that note. Ok. Lets pair on what the end state should be tomorrow.

@jayunit100

Copy link
Copy Markdown
Contributor

hiya @asivanadi0 thank you!

OK I think this could work.

I am wondering wether there's any kind of packaging changes we should do to to make sure the non ui code can be packaged differently, but maybe I'm over engineering it I'n my head?

I was thinking about CVE payloads in the artifacts, also, as one of the problems to solve.

@asivanadi0

Copy link
Copy Markdown
Author

Yeah, worth looking at. This toggle only skips deploying the UI; it doesn’t change what’s in the images.

Did you have a particular image or dependency in mind for the CVE concern? I’d keep this PR focused on the toggle may be? Packaging handled and seperately at #3430.

@jayunit100

Copy link
Copy Markdown
Contributor

Ah ya lets split that out to a separate issue to keep the chains flowing good idea.

I will try to test this today if I can set up a cloud acct.

@Charlesthebird Charlesthebird left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This automated review is a first pass. A manual review will follow once the blockers are addressed.


Nothing blocks merge. One Medium: a misconfigured ui.pdb still fails the render when ui.enabled=false.

What I checked ⚠️
  • Each UI template is gated on ui.enabled; ConfigMaps, Deployment, Service, ServiceAccount, PDB, HTTPRoute and Route all covered ✅
  • helm template with ui.enabled=false, ui.pdb.enabled=true, ui.pdb.minAvailable=5 fails in ui-pdb.yaml:2 ⚠️
  • Default ui.enabled: true keeps existing installs unchanged ✅

Written by 🤖

Comment thread helm/kagent/templates/ui-pdb.yaml Outdated
@@ -1,6 +1,6 @@
{{- $pdb := .Values.ui.pdb | default dict }}
{{- include "kagent.pdb.validate" (dict "pdb" $pdb "path" "ui.pdb") }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Level: 🟠 Medium · Not Blocking

kagent.pdb.validate runs before the ui.enabled guard, so a stale ui.pdb (e.g. both minAvailable and maxUnavailable set) still fails helm template with the UI off. Move the include inside the if.

Written by 🤖

port: http
periodSeconds: 30
{{- end }}
{{ end }} No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[nit]
Level: 🟡 Low · Not Blocking

The closing {{ end }} has no - and the file has no trailing newline; {{- end }} plus a newline matches the other templates (same in the other four gated UI templates).

Written by 🤖

@Charlesthebird

Copy link
Copy Markdown
Collaborator

Terminal: helm template --set ui.enabled=false — before: 5 UI objects still render (configmap, deployment, nginx-configmap, service, serviceaccount); after: none.

reel.mp4

Written by 🤖

@Charlesthebird Charlesthebird left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me! This will need another approver, and we might want to address the review comments above.

[edit] there are also failing tests but I'm not sure if these are flakes.

Signed-off-by: Anpoo Sivanadi <sivanadi08@gmail.com>
Signed-off-by: Anpoo Sivanadi <sivanadi08@gmail.com>
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.

3 participants