This repository contains code relevant for the frontend component required in the Control Plane UI (MCP UI), which is part of the @openmcp-project, more info here.
The Control Plane UI empowers endusers to create and manage Projects, Workspaces and ControlPlanes, without installing any additional tools.
It allows users to observe and edit managed resources of the Onboarding API, as well as the control planes it creates.
Our goal is to provide quick access, simple overview, and encourage users to create cloud landscapes using Kubernetes Ressource Model.
npm i- Copy
frontend-config.jsontopublic/frontend-config.jsonand adapt thebackendUrlaccording to your setup (see section Dynamic Frontend Config). - Copy
.env.templateto.envand fill in the missing values.
npm run devThe UI will be served on http://localhost:5173.
The UI embeds Headlamp to visualize any Kubernetes resource running inside of ControlPlane.
For local development a kind cluster is used.
Prerequisites: kind, kubectl, helm, task (Taskfile)
One-time setup — creates the kind cluster, installs Headlamp with the latest plugin releases from ArtifactHub, and port-forwards to http://localhost:8090:
task headlamp:devThen set HEADLAMP_UPSTREAM_URL=http://localhost:8090 in your .env and start the app:
npm run devDevelop a plugin — if you have crossplane-headlamp-plugin or kiosk-headlamp-plugin checked out as in the same dicrectory next to this repo, build and hot-sync them into the running pod (no restart needed):
task headlamp:updateThen hard-refresh the browser (Cmd+Shift+R).
Note: The frontend is currently incompatible with Safari when running locally on localhost.
To enable local development with Safari, follow these steps on your local machine:
-
Update Cookie Settings:
Inserver/encrypted-session.js, set thesecureproperty tofalsein both occurrences. -
Disable Helmet Registration:
Inserver.js, comment out or remove the registration ofhelmet.
npm run buildnpm run previewUse the docker image which uses nginx for best performance and small bundle size.
docker build -t my-label .We plan to ship this component as a PlatformService of Open Control Plane.
The frontend loads a frontend-config.json file from the root folder containing dynamic config like the backend url. For development, the file frontend-config.json can be copied to public/frontend-config.json. For production, NGINX will serve the content from the environment variable BACKEND_CONFIG.
An example docker run command would be
docker run -p 5001:80 -e BACKEND_CONFIG="$(cat frontend-config.json)" -t ui-test
GraphQL types can be generated from the remote schema using the generate-graphql-types script. Pass your access token as a positional argument directly after the script name:
npm run generate-graphql-types -- myaccesstokenhereTo run in watch mode (re-generates on file changes):
npm run generate-graphql-types:watch -- myaccesstokenhereThe token is automatically prefixed with Bearer and passed as the Authorization header when fetching the remote GraphQL schema.
The schema is fetched from the kubernetes-graphql-gateway. Getting the required access token depends on how you deploy your platform. For OIDC setups, use kubelogin (kubectl oidc-login) to obtain the token — this is an example of an IDP-centered setup. More guidance coming soon.
kubectl oidc-login get-token
--oidc-issuer-url=<according to your setup>
--oidc-client-id=<according to your setup> --oidc-extra-scope=offline_access
--oidc-extra-scope=email
--oidc-extra-scope=profile
--oidc-use-pkce
--grant-type=auto | jq .status.token -r
This project is open to feature requests/suggestions, bug reports etc. via GitHub issues. Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
If you find any bug that may be a security problem, please follow our instructions at in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Copyright OpenControlPlane contributors. Please see our LICENSE for copyright and license information. Detailed information including third-party components and their licensing/copyright information is available via the REUSE tool.
OpenControlPlane is part of ApeiroRA, an EU Important Project of Common European Interest (IPCEI-CIS).
Copyright Linux Foundation Europe. For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.