From e06e9bee0745e76beccb8d7e3810548fd46207db Mon Sep 17 00:00:00 2001 From: Josune Cordoba <49480155+josunect@users.noreply.github.com> Date: Thu, 6 Jun 2024 09:28:38 +0100 Subject: [PATCH] docs(kiali): update development doc for alpha backend(#1720) docs(kiali): update development doc for alpha backend --- plugins/kiali/DEVELOPMENT.md | 53 ++++++++++-------------------------- 1 file changed, 14 insertions(+), 39 deletions(-) diff --git a/plugins/kiali/DEVELOPMENT.md b/plugins/kiali/DEVELOPMENT.md index 25eccd88fa..c4ba988ddb 100644 --- a/plugins/kiali/DEVELOPMENT.md +++ b/plugins/kiali/DEVELOPMENT.md @@ -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 { - 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: @@ -107,7 +72,7 @@ # highlight-add-end ``` -6. Add catalog +5. Add catalog Add to locations in `app-config.local.yaml` @@ -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: