Skip to content

[feat i2g]add in-cluster console for model comparison#4728

Open
shuqz wants to merge 8 commits into
kubernetes-sigs:mainfrom
shuqz:in-cluster-console
Open

[feat i2g]add in-cluster console for model comparison#4728
shuqz wants to merge 8 commits into
kubernetes-sigs:mainfrom
shuqz:in-cluster-console

Conversation

@shuqz
Copy link
Copy Markdown
Collaborator

@shuqz shuqz commented May 7, 2026

Description

  • this is a large PR, see each commit for breakdown
  • for commit 0923067, can focus on changes under /console
  • pkg/ingress2gateway/console/static/index.html is a large file since it is UI -> maybe it is better to actually try out console following documentation instructions
  • 163696d contains complete documentation for in-cluster console, start from there
  • the change is mostly for console with a bug fix in migration tool

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 7, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shuqz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 7, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 7, 2026

Codecov Report

❌ Patch coverage is 82.87154% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.52%. Comparing base (22cdb42) to head (868bf04).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
pkg/ingress2gateway/console/server.go 67.04% 22 Missing and 7 partials ⚠️
pkg/ingress2gateway/console/discovery.go 77.47% 14 Missing and 11 partials ⚠️
pkg/ingress2gateway/console/classify.go 90.00% 3 Missing and 1 partial ⚠️
pkg/ingress2gateway/console/correlate.go 81.81% 2 Missing and 2 partials ⚠️
pkg/ingress2gateway/console/differ.go 96.33% 4 Missing ⚠️
pkg/ingress2gateway/console/model.go 92.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4728      +/-   ##
==========================================
+ Coverage   56.09%   56.52%   +0.43%     
==========================================
  Files         388      394       +6     
  Lines       30932    31381     +449     
==========================================
+ Hits        17352    17739     +387     
- Misses      12566    12607      +41     
- Partials     1014     1035      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@k8s-triage-robot
Copy link
Copy Markdown

Unknown CLA label state. Rechecking for CLA labels.

Send feedback to sig-contributor-experience at kubernetes/community.

/check-cla
/easycla

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 7, 2026
Comment thread controllers/ingress/group_controller.go Outdated
r.logger.Info("successfully built model", "model", stackJSON)

if r.featureGates.Enabled(config.IngressPlanAnnotation) && len(ingGroup.Members) > 0 {
if err := patchDryRunPlanAnnotation(ctx, r.k8sClient, ingGroup.Members[0].Ing, stackJSON); err != nil {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it is always patched to members[0] for group ingress. members in a group is sorted by group order. if group order is not specified, it is sorted by lexical order based on namespacedName. i think it is deterministic. and even if it changed, we will still pick up the new members[0] to write annotation and cleanup stale annotations (see line 239 below). as for how it is been discovered from gateway, gateway will list all ingress from a group and find one with dry run plan annotation.

let me know if you still prefer to write it to oldest ingress

These warnings are informational — the tool still generates output. For the most accurate results, use `--from-cluster` which automatically fetches all referenced resources.

## Migration Console (Web UI)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i am going to create a new page for console, including screenshot from console as example and instructions to use. but just make it short here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,112 @@
package console
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

please review this file. this is where we define which changes are "Expected"

Comment thread cmd/lbc-migrate/main.go
Comment thread pkg/ingress2gateway/console/static/index.html Outdated
Comment thread pkg/ingress2gateway/console/static/index.html Outdated
Comment on lines +1238 to +1240
const escapeHTML = (s) => String(s).replace(/[&<>"']/g, c => (
{ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]
));
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.

Do any other characters need to be escaped? Ex. =, /

`<div class="error-msg">${escapeHTML(gw.error)}</div>`);
return;
}
document.querySelectorAll('.error-msg').forEach(e => e.remove());
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.

Why do we want to remove the error messages?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

clears stale error messages from the DOM when navigating

Comment thread pkg/ingress2gateway/console/static/index.html Outdated
.gw-rail-label {
display: none;
align-items: center;
padding: 0 16px;
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.

There's a lot of "magic numbers" in the CSS. Could you also define some of the more common ones (like 12px, 16px, etc.) in :root, similar to what you did for some of the more common colors so it's clear why they're set at those sizes?

<!-- TOPBAR -->
<header class="topbar">
<a class="brand" href="/" id="brand" aria-label="Home">
<span class="brand-wordmark">aws<span class="kbd">›</span></span>
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.

Nit: Would double check that most class names are readable. Using this as an example, I'm not too sure what kbd represents.

Comment thread pkg/ingress2gateway/console/static/index.html Outdated
Comment thread pkg/ingress2gateway/console/static/index.html Outdated

let target = viewLeft;
if (tabLeft < viewLeft) {
target = tabLeft - 12; // small gutter
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.

Similar comment about magic numbers, would be good to define these constants somewhere with descriptive names so it's understood why this number in particular is chosen as the gutter size. Also makes adjusting the size easier down the line as adjusting a constant is easier than many instances of 12.

@shuqz shuqz force-pushed the in-cluster-console branch from ad76b35 to 3edf139 Compare May 12, 2026 20:26
shuqz added 2 commits May 12, 2026 13:51
…igs#4734)

The IngressPlanAnnotation feature gate, dryrun.go controller logic,
and related helm/docs changes are now in a separate PR. This branch
retains only the IngressSuffixDryRunPlan constant which the console
reads from existing ingress annotations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants