-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat!: Make API container fully stateless and independent of frontend #8708
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #8708 +/- ##
==========================================
- Coverage 42.26% 35.77% -6.49%
==========================================
Files 219 252 +33
Lines 12195 10708 -1487
Branches 179 157 -22
==========================================
- Hits 5154 3831 -1323
+ Misses 6743 6626 -117
+ Partials 298 251 -47 |
…into feat/stateless-api
could you devide PR for bumping golang to 1.22? |
is there any reason to split that into a separate PR? |
K8s v1.30 will bump golang to 1.22, so if this PR is going to take a long time, I thought it would be better to do it separately. |
…into feat/stateless-api
…into feat/stateless-api
…ateless-api # Conflicts: # modules/web/i18n/de/messages.de.xlf # modules/web/i18n/es/messages.es.xlf # modules/web/i18n/fr/messages.fr.xlf # modules/web/i18n/ja/messages.ja.xlf # modules/web/i18n/ko/messages.ko.xlf # modules/web/i18n/messages.xlf # modules/web/i18n/zh-Hans/messages.zh-Hans.xlf # modules/web/i18n/zh-Hant-HK/messages.zh-Hant-HK.xlf # modules/web/i18n/zh-Hant/messages.zh-Hant.xlf
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: floreks, maciaszczykm The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Breaking change
This PR introduces a couple of important changes to how Kubernetes Dashboard generally works. It will require a clean installation once released.
API container
It is now fully stateless, meaning it does not rely on Kubernetes resources to run. It will always require an authorization token to be present to authorize the request. It is no longer possible for the API container to use its own SA privileges to skip authorization. All arguments that were frontend specific have either been removed or moved to the Web container.
Auth container
Authentication logic is now handled by the new dashboard auth container. Currently, it only exposes
/login
endpoint. We will also add support for OIDC with OAuth flow and/me
endpoint in the future.Web container
Go backend
restful-go
withgin
as main web frameworkAngular frontend
Since API requires the user to always provide
Authorization: Bearer <token>
now, there is no way to skip login and act as a Dashboard.token
skip
login optionKong gateway
Since the number of our containers is growing as we split parts of the logic, we have decided to use a gateway that will connect all of them and ensure the Dashboard is working properly. There were a couple of reasons to choose Kong:
It will now be a required dependency that we use to expose the Dashboard. Users can then reconfigure it or use another proxy in front of it. It will simply act as a single point when accessing the Kubernetes Dashboard.
Metrics scraper
sqlite
Go dependency to used driver implementation that does not requireCGO_ENABLED=1
during the build. It is a pure Go implementation.Dev pipeline
Master
Makefile
located in project root now exposes couple of global targets that are forwarded to correct modules.build
- builds locally all go modules and angular frontend and stores it in<MODULE_DIR>/.dist
directoriescheck
- runs static checks for every module (linting, license, i18n, etc.)clean
- removes all temporary directories such as.tmp
and.dist
coverage
- runs units tests with coverage for all modulesfix
- same ascheck
just with--fix
option.test
- runs unit tests for all modulesTo test the application there are now 2 targets:
serve
- Starts the development version of the application using docker compose. All modules are running in docker with live reload enabled thanks toair
(Go) andng serve
(Angular). Exposes Dashboard frontend onhttp://localhost:8080
run
- Starts the production version of the application using docker compose. Exposes Dashboard frontend onhttp://localhost:8080
andhttps://localhost:8443
.Other changes
klog
as the base logger.--api-log-level
arg have been replaced by--v
and expects a log level number (0-5).Fixes #7445.