Skip to content

Commit eca07ca

Browse files
committed
fix: improve readme
1 parent becdc45 commit eca07ca

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

README.md

+19-23
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,17 @@
44

55
## About this project
66

7-
UI backend for @openmcp-project
7+
This is the backend for our [MCP UI](https://github.com/openmcp-project/ui-frontend).
8+
Its a simple proxy server which sits between the UI frontend and the Kubernetes API server.
89

9-
## Requirements and Setup
10-
11-
Setup: Requires the CRATE_KUBECONFIG environment variable.
12-
Start: Instructions to run the server using go run cmd/server/main.go.
13-
Call UI-backend: Details on how to make requests to the ui-backend with necessary headers for authorization and target API server configuration.
14-
Parsing JSON: Support for jsonpath and jq to parse JSON before sending it to the client.
15-
16-
### Use Case
17-
18-
#### Problem
10+
### Motivation
1911

2012
We want to call the kubernetes api server directly from the browser, but we have several problems preventing us from calling the api from the browser:
2113

2214
- TLS certificate is not signed from a well-known CA
2315
- CORS is not configured most of the time
2416

25-
#### Solution
17+
### Solution
2618

2719
The `ui-backend` server acts like a proxy when talking to the Crate-Cluster or MCPs from the browser.
2820
The browser sends the request to the `ui-backend`, with authorization data and optionally the project, workspace and controlplane name of the MCP in header data.
@@ -32,34 +24,39 @@ The browser sends the request to the `ui-backend`, with authorization data and o
3224

3325
There are only some modifications done when piping the request to the api server, preventing some headers from going through.
3426

35-
### Usage
27+
## Requirements and Setup
28+
29+
You need to have a running mcp landscape. Then reference the KUBECONFIG for the backend using the `KUBECONFIG` environment variable.
3630

37-
#### Setup
31+
The backend can be started using:
3832

39-
The service needs only one mandatory environment variable, `CRATE_KUBECONFIG`, with the kubeconfig-yaml as a string. The `.users` field does not has to be set, as this part will get overwritten with the data from the requests.
33+
```bash
34+
go run cmd/server/main.go
35+
```
4036

41-
#### Start
37+
## Usage
4238

43-
Run `go run cmd/server/main.go`
39+
You can reach the backend on port `3000` and the path as you would directly to the api server.
4440

45-
#### Call UI-backend
41+
```txt
42+
For example: http://localhost:3000/api/v1/namespaces
43+
```
4644

47-
Call `ui-backend` with the http-method and path as you would directly to the api server.
4845
Put the authorization data in the following headers:
4946

5047
- `X-Client-Certificate-Data`
5148
- `X-Client-Key-Data`
5249

5350
or (for OIDC):
5451

55-
- `Authorization`
52+
- `Authorization: <token>`
5653

5754
Also configure the api-server you want to call:
5855

5956
- Crate: Add the header `X-Use-Crate-Cluster: true`
6057
- MCP: Add the headers `X-Project-Name`, `X-Workspace-Name` and `X-Control-Plane-Name`
6158

62-
#### Parsing JSON
59+
## Parsing JSON
6360

6461
`ui-backend` support jsonpath (kubectl version) and jq (gojq) to parse json before sending it to the client, reducing the data transfered to the client.
6562

@@ -70,8 +67,7 @@ Usage:
7067

7168
### Deployment
7269

73-
- Docker-Image: deploy-releases-hyperspace-docker.common.repositories.cloud.sap/cloud-orchestration/cola/ui-backend
74-
- Helm-Chart: oci://europe-docker.pkg.dev/sap-gcp-cp-k8s-stable-hub/cola/charts/ui-backend (is manually pushed)
70+
- Docker-Image: `ghcr.io/openmcp-project/ui-backend`
7571

7672
## Support, Feedback, Contributing
7773

0 commit comments

Comments
 (0)