Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update docs about recent changes related to kyma-dashboard #3347

Merged
merged 12 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Busola project contains additional sub-projects:

- [`Backend`](./backend) - A kind of a proxy between Busola and the Kubernetes cluster
- [`Tests`](./tests) - Acceptance, regression and integration tests
- [`Kyma`](./kyma) - Kyma specific configuration for Busola

## Prerequisites

Expand Down Expand Up @@ -69,6 +70,7 @@ Busola configuration is the product of gathering and merging the configurations
This data is mounted to the Busola `web` and `backend` Pods, and during the local development,
the [defaultConfig.yaml](public/defaultConfig.yaml) file is used.
- Target cluster configuration, available on the target cluster in ConfigMap "kube-public/busola-config" under the key "config". Busola performs a request for that resource during the bootstrap process.
- Custom configuration with `extensibility` and `config` located in **public/environments**, [read more](#environment-specific-settings).

### Change the Configuration

Expand All @@ -84,6 +86,35 @@ Features comprise the following elements:

See the available Busola [feature flags](docs/features.md) for more information.

#### Environment-Specific Settings

You can provide an override to the default configuration with your own environment-specific settings.
Follow this pattern to structure your custom environment directory and place it in `public/environments`.

```
custom-env/
├── config
│ └── config.yaml
└── extensions
├── extensions.yaml
└── wizards.yaml
```

> [!WARNING]
> The `extensions.yaml`, `statics.yaml`, `wizards.yaml`, and `config.yaml` files are necessary for Busola to work properly.

To activate your environment configuration, create or edit the `active.env` file in the [public directory](./public).
Follow this example of the `active.env` file:

```dotenv
ENVIRONMENT=your-environment-name
```

When **ENVIRONMENT** is set to `my-env`, Busola looks for your custom configuration in `public/environemnt/my-env`.
If **ENVIRONMENT** is not set, Busola fetches the default configuration with the same structure as the custom configuration located in the [public directory](./public).

In the case of the Docker image, the `active.env` file is created at the startup of the image from the environment specified in the **ENVIRONMENT** variable.

## Development

### Start all views
Expand Down
57 changes: 57 additions & 0 deletions kyma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Kyma Dashboard

## Overview
The directory contains the configuration of Kyma extensibility for Busola and tools to prepare the configuration for building Kyma dashboard using Busola.

Files structure:
```
./extensions/
├── ...
./environments/
├── dev
│ ├── config.yaml
│ ├── extensions.json
│ ├── statics.json
│ └── wizards.json
├── prod
│ ├── config.yaml
│ ├── extensions.json
│ ├── statics.json
│ └── wizards.json
└── stage
├── config.yaml
├── extensions.json
├── statics.json
└── wizards.json

3 directories, 12 files
```

The `environments` directory contains configuration per environment.
The environment configuration contains `config.yaml` for Busola and `extensions.json`, `statics.json`, and `wizards.json` with a list of extensibility configurations.
The entries for extensibility can be `relative path to Kyma directory` or `URL to extension yaml`.

The `extensions` directory contains a general extensibility configuration to avoid duplication in each environment configuration directory.

## Prerequisites

- [`npm`](https://www.npmjs.com/) in version 10.x
- [Node.js](https://nodejs.org/en/) in version 20.x
- [Make](https://www.gnu.org/software/make/)

## Installation
To download all dependencies needed to prepare configurations, run:

Copy link
Contributor

Choose a reason for hiding this comment

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

What is this installation instruction for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used to download all dependencies needed to make prepare-all-configuration to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest adding the information here.

```bash
npm clean-install
```

## Usage

To prepare the final configuration for Busola, run:
```bash
make prepare-all-configuration
```

This target fetches and copies the configuration file to the `temp` directory.
Then, all the files are merged and moved to the final `build` directory.
20 changes: 10 additions & 10 deletions tests/kyma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

## Overview

This project contains integration and smoke UI tests for Kyma-Dashboard.
This project contains integration and smoke UI tests for Kyma dashboard.

## Prerequisites

Before testing, you need to copy your cluster's kubeconfig file to `fixtures/kubeconfig.yaml`.

You need to have ran Kyma-Dashboard using docker and PR number:
First, run Busola using Docker, PR number, and - optionally - your desired environment:

```bash
PR_NUMBER={YOUR_PR_NUMBER} npm run run-docker
PR_NUMBER={YOUR_PR_NUMBER} ENV={DESIRED_ENV} npm run run-docker
```

## Installation
Expand All @@ -23,19 +23,19 @@ To install dependencies, run the `npm install` command.
### Run Cypress UI tests in the headless mode

To run Cypress UI tests using a Chrome browser in `headless mode`,
pointing to a `remote Kyma-Dashboard` cluster with the default `local.kyma.dev` domain, use this command:
pointing to a `remote Kyma dashboard` cluster with the default `local.kyma.dev` domain, use this command:

```bash
npm test
```

To run the tests, pointing to a `remote Kyma-Dashboard` cluster with `custom` domain, use this command:
To run the tests, pointing to a `remote Kyma dashboard` cluster with `custom` domain, use this command:

```bash
CYPRESS_DOMAIN={YOUR_DOMAIN} npm test
```

To run the tests, pointing to a `local Kyma-Dashboard` instance, use this command:
To run the tests, pointing to a `local Kyma dashboard` instance, use this command:

```bash
npm run test:local
Expand All @@ -44,27 +44,27 @@ npm run test:local
### Run Cypress UI tests in the test runner mode

To open Cypress UI `tests runner`,
pointing to a `remote Kyma-Dashboard` cluster with the default `local.kyma.dev` domain, use this command:
pointing to a `remote Kyma dashboard` cluster with the default `local.kyma.dev` domain, use this command:

```bash
npm run start
```

To open the `tests runner`, pointing to a `remote Kyma-Dashboard` cluster with `custom` domain, use this command:
To open the `tests runner`, pointing to a `remote Kyma dashboard` cluster with `custom` domain, use this command:

```bash
CYPRESS_DOMAIN={YOUR_DOMAIN} npm run start
```

To open the `tests runner`, pointing to a `local Kyma-Dashboard` instance, use this command:
To open the `tests runner`, pointing to a `local Kyma dashboard` instance, use this command:

```bash
npm run start:local
```

### Smoke tests

To run smoke tests, pointing to a local Kyma-Dashboard instance, use this command:
To run smoke tests, pointing to a local Kyma dashboard instance, use this command:

```bash
test:smoke-extensions
Expand Down
2 changes: 1 addition & 1 deletion tests/kyma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test:e2e": "cypress run --browser chromium",
"test:local": "CYPRESS_LOCAL_DEV=true cypress run --browser chrome",
"test:smoke-extensions": "cypress run --browser chromium -C cypress-smoke.js",
"run-docker": "docker run --rm -it -p 3001:3001 -e DOCKER_DESKTOP_CLUSTER=true --pid=host --name kyma-dashboard europe-docker.pkg.dev/kyma-project/dev/kyma-dashboard-local-dev:PR-$PR_NUMBER"
"run-docker": "docker run --rm -it -p 3001:3001 -e DOCKER_DESKTOP_CLUSTER=true --net=host --pid=host --name kyma-dashboard --env ENVIRONMENT=$ENV europe-docker.pkg.dev/kyma-project/dev/busola-kyma-web-local:PR-$PR_NUMBER"
},
"devDependencies": {
"cypress-file-upload": "^5.0.8",
Expand Down
Loading