Skip to content

New dashboard based on OpenAPI schema - #1269

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
new-dashboard
Sep 24, 2025
Merged

Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
new-dashboard

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Jul 24, 2025 •

Copy link
Copy Markdown
Member

A new dashboard based on https://github.com/PRO-Robotech/openapi-ui project

Screenshot 2025-08-01 at 09-01-00 OpenAPI UI Screenshot 2025-08-01 at 09-01-14 OpenAPI UI Screenshot 2025-08-01 at 09-02-05 OpenAPI UI

What this PR does

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

@coderabbitai

coderabbitai Bot commented Jul 24, 2025 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

More 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 reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit 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 Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new-dashboard

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

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-ui for the frontend, openapi-ui-k8s-bff as a backend-for-frontend service, and an Nginx proxy for routing. An OAuth2 gatekeeper component is also introduced for authentication.
  • TenantNamespace Resource Implementation: A new cluster-scoped custom resource, TenantNamespace, has been implemented within the cozystack-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 TenantNamespace and dynamically configured custom resources. It also now applies default values to resource specifications based on their OpenAPI schemas.
  • Branding Updates: The new openapi-ui dashboard 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

  1. 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. ↩

@kvaps Andrei Kvapil (kvaps) changed the title new dashboard PoC: new dashboard Jul 24, 2025
@kvaps
Andrei Kvapil (kvaps) marked this pull request as draft July 24, 2025 13:04

@gemini-code-assist gemini-code-assist Bot left a comment

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.

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.

Comment on lines +49 to +55
- --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

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.

critical

This template contains hardcoded secrets and environment-specific URLs, posing a security risk. Move these values to a Kubernetes Secret and reference them, or make them configurable via values.yaml.

spec:
ingressClassName: tenant-root
rules:
- host: incloud.cozydev4.lllamnyp.su

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.

high

The ingress host is hardcoded, limiting flexibility. Template this value and make it configurable via values.yaml.

    - host: {{ .Values.ingress.hostname | quote }}

Comment on lines +16 to +17
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;

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.

high

The nginx configuration contains a hardcoded cluster list and URLs, reducing portability. Template these values for configuration via values.yaml.

@@ -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

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.

medium

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

Comment on lines +31 to +32
IMAGE="$(REGISTRY)/openapi-ui:$(call settag,$(TAG))@$$(yq e '."containerimage.digest"' images/openapi-ui.json -r)" \
yq -i '.openapiUI.image = strenv(IMAGE)' values.yaml

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.

medium

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)

Comment on lines +16 to +19
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 link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To reduce image size and improve security, copy only package.json and package-lock.json to the final stage, then run npm ci --omit=dev to install only production dependencies.

Comment on lines +31 to +32
COPY --from=builder2 /src/node_modules /app/node_modules
COPY --from=builder2 /src/build /app/build

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.

medium

To reduce image size and improve security, copy only package.json and package-lock.json to the final stage, then run npm ci --omit=dev to install only production dependencies.

@kvaps
Andrei Kvapil (kvaps) force-pushed the new-dashboard branch 4 times, most recently from 6541e4e to c8a47ef Compare July 27, 2025 19:21
@klinch0
klinch0 marked this pull request as ready for review August 6, 2025 07:51
@klinch0
klinch0 force-pushed the new-dashboard branch 4 times, most recently from 143327c to dca4806 Compare August 20, 2025 06:24
Andrei Kvapil (kvaps) added a commit that referenced this pull request Sep 1, 2025
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 -->
@kvaps
Andrei Kvapil (kvaps) force-pushed the new-dashboard branch 2 times, most recently from c68b786 to c5ff3a0 Compare September 3, 2025 16:31
@kvaps
Andrei Kvapil (kvaps) force-pushed the new-dashboard branch 4 times, most recently from c9a76c2 to bb68039 Compare September 15, 2025 23:12
@kvaps
Andrei Kvapil (kvaps) force-pushed the new-dashboard branch 3 times, most recently from aad8514 to 230e059 Compare September 18, 2025 12:33
@kvaps
Andrei Kvapil (kvaps) force-pushed the new-dashboard branch 5 times, most recently from 68301ff to fe76862 Compare September 24, 2025 14:16
@kvaps Andrei Kvapil (kvaps) changed the title PoC: new dashboard Introduce new dashboard based on OpenAPI schema Sep 24, 2025
@kvaps Andrei Kvapil (kvaps) changed the title Introduce new dashboard based on OpenAPI schema New dashboard based on OpenAPI schema Sep 24, 2025
@kvaps
Andrei Kvapil (kvaps) force-pushed the new-dashboard branch 6 times, most recently from 27a6323 to d50ee32 Compare September 24, 2025 16:04
…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]>
@kvaps
Andrei Kvapil (kvaps) merged commit bb653e5 into main Sep 24, 2025
20 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the new-dashboard branch September 24, 2025 18:11
Timofei Larkin (lllamnyp) pushed a commit that referenced this pull request Sep 24, 2025
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]>
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.

1 participant