Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hkatz/dashboard and summary overhaul #180

Merged

Conversation

hjkatz
Copy link
Contributor

@hjkatz hjkatz commented Jun 28, 2020

Why?

This is one of the largest PRs I'll be submitting. It's big because it does a complete overhaul of the dashboard (now "web") package and summary packages to support the changes.

Goals:

  • Support Namespace list view
  • Support individual Namespace view
  • Support a more logical structure for a Summary
  • Add testing to Summary

What?

Major Changes:

  • pkg/dashboard -> pkg/web to support more than just "the dashboard" view as there is also a list view too
  • "dashboard" -> "web" in general
  • Split templates by kind
  • Templates and Handlers are more general purpose and can support future additions easily
  • Adjust Summary structure to be more logically consistent with what it's summarizing (Summary -> Namespaces -> Deployments -> Containers)

Minor Changes:

  • Allow web ClusterRole to list Namespaces
  • Typo fixes, Squarespace fixes (stuff pulled in by accident)
  • /namespaces is the new default route
  • Test fixes, Typo Fixes, etc...
  • Add outer structure to Summary
  • Move commonly used labels to pkg/utils

P.S. After this there are a few more PRs but they're all 1-2 commits in size and should be quick. They include:

  • Batch Summary Deployments list into a single API call to improve dashboard speed significantly
  • Add Namespace list search bar/filtering and other friendly js improvements
  • Add Namespace to blank Summary to support specific Namespaces in a more consistent structure
  • Some final VPA touchups to make the business logic of updating VPAs clearer to modify and test
  • Minor typos and QoL changes to catch some bugs (these will be batched into 1 PR)

This PR was already getting enormous so I'm trying to slice it here. I'm comfortable modifying just about anything in this PR now since the hard part was really getting past this point :)

Harrison Katz and others added 30 commits February 28, 2020 15:17
The VPAUpdateMode field will allow us to use Goldilocks to create VPAs
that operate outside of "off" mode.
This commit adds a parameter to createVPA that allows the user to
specify the update mode for the VPA. The mechanism for specifying this
is the label goldilocks.fairwinds.com/vpaUpdateMode.
Kubernetes labels are based on DNS names, which are case insensitive.
However, the current label used to specify the update mode of created
VPAs, vpaUpdateMode, is case sensitive. This has caused a bug that
results in all VPAs being created in "Off" mode. This commit fixes that
bug by using a case-insensitive label to specify the vpa-update-mode.
Also:
 - Update reconciler to use VPA and Deployment objects
   directly (instead of names)
 - Update reconciler logging
 - Update/Add vpa tests
Also:
 - Update vpa tests
 - Fix vpa-opt-out logic
Co-Authored-By: Andrew Suderman <[email protected]>
Co-Authored-By: Andrew Suderman <[email protected]>
@hjkatz hjkatz force-pushed the hkatz/dashboard-and-summary-overhaul branch from 5cdf1c0 to 38889be Compare June 28, 2020 17:50
@hjkatz hjkatz force-pushed the hkatz/dashboard-and-summary-overhaul branch from fca34b3 to 5db0769 Compare June 28, 2020 18:12
@codecov
Copy link

codecov bot commented Jun 28, 2020

Codecov Report

Merging #180 into master will increase coverage by 7.50%.
The diff coverage is 62.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #180      +/-   ##
==========================================
+ Coverage   44.84%   52.35%   +7.50%     
==========================================
  Files           9        8       -1     
  Lines         660      573      -87     
==========================================
+ Hits          296      300       +4     
+ Misses        340      247      -93     
- Partials       24       26       +2     
Impacted Files Coverage Δ
pkg/kube/client.go 17.64% <ø> (ø)
pkg/utils/utils.go 100.00% <ø> (ø)
pkg/summary/summary.go 49.42% <57.14%> (+0.05%) ⬆️
pkg/vpa/vpa.go 71.79% <66.66%> (ø)
pkg/dashboard/helpers/helpers.go 78.66% <80.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a4f125...5fa8536. Read the comment docs.

@hjkatz
Copy link
Contributor Author

hjkatz commented Jun 28, 2020

I literally cannot believe all the e2e tests passed. That's incredible! :D

@hjkatz
Copy link
Contributor Author

hjkatz commented Jul 20, 2020

@lucasreed/@sudermanjr Any chance y'all could lend some 👀 to this PR? 😃

@sudermanjr sudermanjr self-assigned this Jul 20, 2020
@sudermanjr sudermanjr removed the request for review from mgoodhart5 July 20, 2020 15:15
@sudermanjr
Copy link
Member

@lucasreed/@sudermanjr Any chance y'all could lend some 👀 to this PR? 😃

I will try to get a chance to look at this this week.

@lucasreed lucasreed requested a review from rbren July 20, 2020 18:11
Copy link
Contributor

@rbren rbren left a comment

Choose a reason for hiding this comment

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

Haven't tested locally but the code looks great!

cmd/web.go Outdated Show resolved Hide resolved
pkg/kube/client.go Show resolved Hide resolved
pkg/web/health.go Outdated Show resolved Hide resolved
cmd/web.go Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Harrison Katz <[email protected]>
Copy link
Member

@sudermanjr sudermanjr left a comment

Choose a reason for hiding this comment

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

Overall, functionality seems great and I love the namespaced views on the dashboard.

I'm really not a fan of the dashboard -> web rename. It seems to suggest that it does more than display information, which it does not do.

The fact that it also changes the name of all of the kubernetes objects means we will have to completely change the chart, as well as the users experiencing a very heavy shift in what they see in their clusters when deploying.

TL;DR, it seems like a lot of code churn with zero functional purpose.

@lucasreed
Copy link
Contributor

I'm really not a fan of the dashboard -> web rename. It seems to suggest that it does more than display information, which it does not do.

The fact that it also changes the name of all of the kubernetes objects means we will have to completely change the chart, as well as the users experiencing a very heavy shift in what they see in their clusters when deploying.

TL;DR, it seems like a lot of code churn with zero functional purpose.

Agreed, simply changing the package name back to dashboard would make the PR much smaller which would be nice. A lot of secondary changes are only because of the name change (i.e. CONTRIBUTING + README)

Copy link
Contributor

@lucasreed lucasreed left a comment

Choose a reason for hiding this comment

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

Adding official review based on comments above: unclear what the purpose is of renaming the dashboard package. Lets change that back and all the documentation changes around it to have a smaller, more manageable PR.

@hjkatz
Copy link
Contributor Author

hjkatz commented Jul 22, 2020

I'm really not a fan of the dashboard -> web rename. It seems to suggest that it does more than display information, which it does not do.

The fact that it also changes the name of all of the kubernetes objects means we will have to completely change the chart, as well as the users experiencing a very heavy shift in what they see in their clusters when deploying.

TL;DR, it seems like a lot of code churn with zero functional purpose.

Agreed, simply changing the package name back to dashboard would make the PR much smaller which would be nice. A lot of secondary changes are only because of the name change (i.e. CONTRIBUTING + README)

Will do y'all! I originally wanted to rename pkg/dashboard when I found out that it was going to hold more than just a single dashboard page and it felt weird to have dashboard.Dashboard() as well as dashboard.NamespaceList(). I'll revert back to pkg/dashboard and we can move forward from there.

(Edit: It also looks a bit strange to see dashboard.GetRouter(dashboard.OnPort(8000), ...) sort of calls. But it's just an aesthetic thing and supporting existing workflows/Helm charts is much more important imo.)

@hjkatz hjkatz force-pushed the hkatz/dashboard-and-summary-overhaul branch from 6fd77b9 to 84ba32b Compare July 22, 2020 12:36
@hjkatz
Copy link
Contributor Author

hjkatz commented Jul 22, 2020

Ok, pkg/web has been un-renamed back to pkg/dashboard. The PR diff looks a lot smaller now. The file pkg/dashboard/dashboard.go diff is a bit hard to read because git is trying to be smart but it's not pattern matching well on the diff chunks, so I recommend viewing that file alone or in the side-by-side view. @sudermanjr @lucasreed

@hjkatz hjkatz force-pushed the hkatz/dashboard-and-summary-overhaul branch from 84ba32b to eae73cd Compare July 22, 2020 13:15
@hjkatz hjkatz requested a review from lucasreed July 22, 2020 21:01
@sudermanjr sudermanjr self-requested a review August 5, 2020 17:01
Copy link
Contributor

@lucasreed lucasreed left a comment

Choose a reason for hiding this comment

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

LGTM, sorry again for the delay!

@lucasreed lucasreed merged commit 746e30a into FairwindsOps:master Aug 7, 2020
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.

5 participants