Skip to content

Commit

Permalink
docs(kiali): update development doc for alpha backend(#1720)
Browse files Browse the repository at this point in the history
docs(kiali): update development doc for alpha backend
  • Loading branch information
josunect authored Jun 6, 2024
1 parent 6e5dad1 commit e06e9be
Showing 1 changed file with 14 additions and 39 deletions.
53 changes: 14 additions & 39 deletions plugins/kiali/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,48 +44,13 @@
);
```

3. Create a file called `kiali.ts` inside `packages/backend/src/plugins/` and add the following:

```ts title="packages/backend/src/plugins/kiali.tsx"
/* highlight-add-start */
import { Router } from 'express';
// ..
import { createRouter } from '@janus-idp/backstage-plugin-kiali-backend';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
return await createRouter({
logger: env.logger,
config: env.config,
});
}
// ..
/* highlight-add-end */
```

4. import the plugin to `packages/backend/src/index.ts`. There are three lines of code you'll need to add, and they should be added near similar code in your existing Backstage backend.
3. import the plugin to `packages/backend/src/index.ts`.

```typescript title="packages/backend/src/index.ts"
// ..
/* highlight-add-next-line */
import kiali from './plugins/kiali';
async function main() {
// ...
/* highlight-add-next-line */
const kialiEnv = useHotMemoize(module, () => createEnv('kiali'));
// ...
/* highlight-add-next-line */
apiRouter.use('/kiali', await kiali(kialiEnv));
// ...
}
backend.add(import('@janus-idp/backstage-plugin-kiali-backend/alpha'));
```

5. Configure you `app-config.local.yaml` with kiali configuration
4. Configure you `app-config.local.yaml` with kiali configuration

```yaml
catalog:
Expand All @@ -107,7 +72,7 @@
# highlight-add-end
```

6. Add catalog
5. Add catalog

Add to locations in `app-config.local.yaml`

Expand All @@ -118,6 +83,16 @@
target: ../../plugins/kiali/catalog-demo.yaml
```

6. Disable backend authentication for development (If required)

Add the auth config to backend in `app-config.local.yaml`

```yaml
backend:
auth:
dangerouslyDisableDefaultAuthPolicy: true
```

7. Run `yarn start:backstage` from the project root.
8. After create a new component, the Kiali tab should be enabled:

Expand Down

0 comments on commit e06e9be

Please sign in to comment.