-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Serve frontend from go * Build UI static files * Change metrics server port * Add API config fields in deployment * Fix serving API on 8080 port * Add makefile rule to build ui * Change the order of makefile rules * eslint * eslint * Fix dockerfile copy * Add doc describing how to deploy BTP Manager with UI * Fix docs * Add cleanup info, prerequisites info and fix formatting * Typos * Apply suggestions from doc review Co-authored-by: Iwona Langer <[email protected]> * Rename ui.md to 09-10-ui.md --------- Co-authored-by: Iwona Langer <[email protected]>
- Loading branch information
1 parent
7b96474
commit 5adbe6e
Showing
12 changed files
with
179 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# BTP Manager User Interface | ||
|
||
> [!WARNING] | ||
> This feature is in the experimental stage and is not yet available in the main branch or official releases. | ||
> Use the latest development image to test the UI: europe-docker.pkg.dev/kyma-project/dev/btp-manager:PR-720 | ||
## Prerequisites | ||
For clusters different from Kyma (for example, k3d) you need to install the [prerequisites](../../deployments/prerequisites.yaml). | ||
```shell | ||
kubectl apply -f deployments/prerequisites.yaml | ||
``` | ||
|
||
|
||
## Run BTP Manager with UI | ||
Follow the steps below to run BTP Manager with UI: | ||
1. Connect `kubectl` to your cluster by setting the **KUBECONFIG** environment variable. | ||
```shell | ||
export KUBECONFIG=<path-to-kubeconfig> | ||
``` | ||
2. Make sure the `btp-operator` module is disabled and there are no existing BtpOperator custom resources (CRs) and deployments of BTP Manager and the SAP BTP service operator. | ||
```shell | ||
kubectl get btpoperators -A | ||
kubectl get deployment -n kyma-system btp-manager-controller-manager | ||
kubectl get deployment -n kyma-system sap-btp-operator-controller-manager | ||
``` | ||
3. Clone the `btp-manager` repository and checkout to the `sm-integration` branch. | ||
```shell | ||
git clone https://github.com/kyma-project/btp-manager.git | ||
git checkout sm-integration | ||
``` | ||
4. Set the **IMG** environment variable to the image of BTP Manager with UI. | ||
```shell | ||
export IMG=europe-docker.pkg.dev/kyma-project/dev/btp-manager:PR-720 | ||
``` | ||
5. Run `deploy` makefile rule to deploy BTP Manager with UI. | ||
```shell | ||
make deploy | ||
``` | ||
6. Check if BTP Manager deployment is running. | ||
```shell | ||
kubectl get deployment -n kyma-system btp-manager-controller-manager | ||
``` | ||
If you encounter the following error during Pod creation due to Warden's admission webhook: | ||
``` | ||
Error creating: admission webhook "validation.webhook.warden.kyma-project.io" denied the request: Pod images europe-docker.pkg.dev/kyma-project/dev/btp-manager:PR-720 validation failed | ||
``` | ||
you must scale the BTP Manager deployment to 0 replicas, delete the webhook, and the scale the deployment back to 1 replica. | ||
```shell | ||
kubectl scale deployment -n kyma-system btp-manager-controller-manager --replicas=0 | ||
kubectl delete validatingwebhookconfigurations.admissionregistration.k8s.io validation.webhook.warden.kyma-project.io | ||
kubectl scale deployment -n kyma-system btp-manager-controller-manager --replicas=1 | ||
``` | ||
7. Apply BtpOperator CR to create the Secret with credentials to access Service Manager. | ||
```shell | ||
kubectl apply -n kyma-system -f examples/btp-operator.yaml | ||
``` | ||
8. Port-forward to BTP Manager deployment. | ||
```shell | ||
kubectl port-forward -n kyma-system deployment/btp-manager-controller-manager 8080:8080 | ||
``` | ||
9. Access the UI by opening `localhost:8080` in your browser. | ||
### Cleanup | ||
After testing the UI, you can delete the BtpOperator CR and BTP Manager deployment. | ||
1. Delete the BtpOperator CR. | ||
```shell | ||
kubectl delete -n kyma-system btpoperator btpoperator | ||
``` | ||
2. Delete BTP Manager deployment by running the `undeploy` makefile rule. | ||
```shell | ||
make undeploy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
function api(url :string) { | ||
return `http://localhost:3006/api/${url}` | ||
return `http://localhost:8080/api/${url}` | ||
} | ||
|
||
export default api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ui | ||
|
||
import ( | ||
"embed" | ||
"io/fs" | ||
"log" | ||
"net/http" | ||
) | ||
|
||
//go:embed all:build | ||
var build embed.FS | ||
|
||
func NewUIStaticFS() http.FileSystem { | ||
uiFS, err := fs.Sub(build, "build") | ||
if err != nil { | ||
log.Fatal("cannot load ui files:", err) | ||
} | ||
return http.FS(uiFS) | ||
} |