Repository navigation
New dashboard based on OpenAPI schema - #1269
Conversation
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 152 files out of 298 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. ✨ Finishing touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Summary of Changes
Hello Andrei Kvapil (@kvaps), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request represents a significant architectural shift for the dashboard, moving away from Kubeapps to a custom openapi-ui based solution. Concurrently, it introduces a new API resource for managing tenant-specific namespaces, enhancing the platform's multi-tenancy capabilities and UI extensibility.
Highlights
- Dashboard Replacement: The existing Kubeapps-based dashboard has been completely replaced with a new solution built on
openapi-ui. This involves removing all Kubeapps-related Helm charts, Dockerfiles, and Kubernetes manifests. - New Dashboard Architecture: The new dashboard leverages
openapi-uifor the frontend,openapi-ui-k8s-bffas a backend-for-frontend service, and an Nginx proxy for routing. An OAuth2gatekeepercomponent is also introduced for authentication. - TenantNamespace Resource Implementation: A new cluster-scoped custom resource,
TenantNamespace, has been implemented within thecozystack-api. This resource provides a read-only abstraction over Kubernetes Namespaces whose names start with 'tenant-'. - UI Customization CRDs: Several new Custom Resource Definitions (CRDs) are added to support UI customization and management within the new dashboard, including resources for breadcrumbs, custom columns, forms, marketplace panels, and navigation.
- API Server Enhancements: The API server's resource registration mechanism has been updated to handle both compile-time (static) resources like
TenantNamespaceand dynamically configured custom resources. It also now applies default values to resource specifications based on their OpenAPI schemas. - Branding Updates: The new
openapi-uidashboard includes a patch to update its branding, changing the footer text and logo to align with Cozystack's identity.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | Gemini (@gemini-code-assist) | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
64a05f9 to
c3f831c
Compare
There was a problem hiding this comment.
Code Review
This pull request introduces a new dashboard based on openapi-ui and implements the TenantNamespace resource. The changes are extensive and represent a significant architectural shift for the dashboard.
I've identified critical issues, including hardcoded secrets and a duplicated code block. There are also high and medium severity issues related to build reproducibility, Docker image optimization, and maintainability.
My review provides specific suggestions to resolve these issues.
| - --client-id=incloud | ||
| - --client-secret=t9KAmg71Tpch8oo1ffI4a5d3E1zDzo4U | ||
| - --discovery-url=https://keycloak.cozydev4.lllamnyp.su/realms/cozy | ||
| - --enable-refresh-tokens=true | ||
| - --encryption-key=ooTh6Chei1eefooyovai5ohwienuquoh | ||
| - --listen=0.0.0.0:8000 | ||
| - --redirection-url=https://incloud.cozydev4.lllamnyp.su |
| spec: | ||
| ingressClassName: tenant-root | ||
| rules: | ||
| - host: incloud.cozydev4.lllamnyp.su |
| set $cluster_list '[{"api":"incloud-api.cozydev4.lllamnyp.su","baseDomain":"cozydev4.lllamnyp.su","description":"incloud.cozydev4.lllamnyp.su","externalDomain":"incloud.cozydev4.lllamnyp.su","name":"cozydev4","tenant":"dev"}]'; | ||
| return 200 $cluster_list; |
| @@ -1,2 +1,2 @@ | |||
| cozystackAPI: | |||
| image: ghcr.io/cozystack/cozystack/cozystack-api:v0.34.0@sha256:dad88c168719dcaa0b2e6bab352a90f44f4e23c58f525f96841cfce357920bdf | |||
| image: ghcr.io/cozystack/cozystack/cozystack-api:latest@sha256:c4621f51887fc2693d459524dcc45b9b7fdea833b359395566a2e480ee2445e1 | |||
There was a problem hiding this comment.
While pinning the image with its SHA256 digest enhances reproducibility, using the latest tag can be misleading. Consider using a specific version tag (e.g., v0.34.0) for clarity and to avoid confusion during rollbacks or debugging.
image: ghcr.io/cozystack/cozystack/cozystack-api:v0.34.0@sha256:c4621f51887fc2693d459524dcc45b9b7fdea833b359395566a2e480ee2445e1
| IMAGE="$(REGISTRY)/openapi-ui:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/openapi-ui.json -r)" \ | ||
| yq -i '.openapiUI.image = strenv(IMAGE)' values.yaml |
There was a problem hiding this comment.
Consider using a Makefile define block to avoid duplicated code for image-openapi-ui and image-openapi-ui-k8s-bff. This improves readability and maintainability.
define build_and_update_image
docker buildx build images/$(1) \
--provenance false \
--builder=$$(BUILDER) \
--platform=$$(PLATFORM) \
--tag $$(REGISTRY)/$(1):$$(call settag,$$(TAG)) \
--cache-from type=registry,ref=$$(REGISTRY)/$(1):latest \
--cache-to type=inline \
--metadata-file images/$(1).json \
--push=$$(PUSH) \
--label "org.opencontainers.image.source=https://github.com/cozystack/cozystack" \
--load=$$(LOAD)
IMAGE="$$(REGISTRY)/$(1):$$(call settag,$$(TAG))@$$$$(yq e '."containerimage.digest"' images/$(1).json -r)" \
yq -i '.$(2).image = strenv(IMAGE)' values.yaml
rm -f images/$(1).json
endef
image-openapi-ui:
$(call build_and_update_image,openapi-ui,openapiUI)
image-openapi-ui-k8s-bff:
$(call build_and_update_image,openapi-ui-k8s-bff,openapiUIK8sBff)
| COPY --from=builder /src/package*.json /app/ | ||
| COPY --from=builder /src/node_modules /app/node_modules | ||
| COPY --from=builder /src/src/swagger/swagger-output.json /app/dist/swagger/swagger-output.json | ||
| COPY --from=builder /src/dist /app/dist |
| COPY --from=builder2 /src/node_modules /app/node_modules | ||
| COPY --from=builder2 /src/build /app/build |
6541e4e to
c8a47ef
Compare
46232d3 to
bde553b
Compare
143327c to
dca4806
Compare
Signed-off-by: Andrei Kvapil <[email protected]> <!-- Thank you for making a contribution! Here are some tips for you: - Start the PR title with the [label] of Cozystack component: - For system components: [platform], [system], [linstor], [cilium], [kube-ovn], [dashboard], [cluster-api], etc. - For managed apps: [apps], [tenant], [kubernetes], [postgres], [virtual-machine] etc. - For development and maintenance: [tests], [ci], [docs], [maintenance]. - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Add the label `backport` if it's a bugfix that needs to be backported to a previous version. --> ## What this PR does This PR removes bitnami images from all charts. Bitnami has deprecated their free images, see details here: - bitnami/charts#35164 Also dashboard has moved helper images to `bitnamilegacy`, we will fully replace it by our new dashboard soon: - #1269 ### Release note <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same [label] as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note Get rid of bitnami images ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * New Features * Added configurable image overrides for Kubeapps components (frontend, auth proxy, Redis, kubectl). * Introduced image settings for Velero’s kubectl helper. * Added image configuration for Vertical Pod Autoscaler components. * Added a configurable resize hook image for SeaweedFS volumes. * Chores * Standardized kubectl-related images to alpine/k8s:1.33.4 across multiple operational hooks (VM update, PVC resize, etcd maintenance, SeaweedFS pre-upgrade), with no behavioral changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
c68b786 to
c5ff3a0
Compare
c9a76c2 to
bb68039
Compare
aad8514 to
230e059
Compare
68301ff to
fe76862
Compare
27a6323 to
d50ee32
Compare
…t and TenantSecretsTable resources [cozystack-controller] Introduce new dashboard-controller [dashboard] Introduce new dashboard based on openapi-ui Co-authored-by: kklinch0 <[email protected]> Signed-off-by: kklinch0 <[email protected]> Signed-off-by: Andrei Kvapil <[email protected]>
d50ee32 to
0afc3c1
Compare
A new dashboard based on https://github.com/PRO-Robotech/openapi-ui project <img width="1720" height="1373" alt="Screenshot 2025-08-01 at 09-01-00 OpenAPI UI" src="https://github.com/user-attachments/assets/7ae04789-24ec-4e4b-830b-6f16e96513eb" /> <img width="1720" height="1373" alt="Screenshot 2025-08-01 at 09-01-14 OpenAPI UI" src="https://github.com/user-attachments/assets/ca5aa85d-43f0-4b5b-b87a-3bc237834f10" /> <img width="1720" height="1373" alt="Screenshot 2025-08-01 at 09-02-05 OpenAPI UI" src="https://github.com/user-attachments/assets/ebee7bfa-c3ac-4fe6-b5e1-43e9e7042c6a" /> <!-- Thank you for making a contribution! Here are some tips for you: - Start the PR title with the [label] of Cozystack component: - For system components: [platform], [system], [linstor], [cilium], [kube-ovn], [dashboard], [cluster-api], etc. - For managed apps: [apps], [tenant], [kubernetes], [postgres], [virtual-machine] etc. - For development and maintenance: [tests], [ci], [docs], [maintenance]. - If it's a work in progress, consider creating this PR as a draft. - Don't hesistate to ask for opinion and review in the community chats, even if it's still a draft. - Add the label `backport` if it's a bugfix that needs to be backported to a previous version. --> <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same [label] as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note [cozystack-api] Implement TenantNamespace, TenantModules, TenantSecret and TenantSecretsTable resources [cozystack-controller] Introduce new dashboard-controller [dashboard] Introduce new dashboard based on openapi-ui ``` Signed-off-by: Timofei Larkin <[email protected]>
A new dashboard based on https://github.com/PRO-Robotech/openapi-ui project
What this PR does
Release note