# @aljesusg/backstage-plugin-kiali

> The Kiali Plugin This plugin exposes information about your entity-specific ServiceMesh objects.

Latest version **1.8.5** (published 2024-02-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @aljesusg/backstage-plugin-kiali
pnpm add @aljesusg/backstage-plugin-kiali
yarn add @aljesusg/backstage-plugin-kiali
bun add @aljesusg/backstage-plugin-kiali
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; large bundle.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.8.5 |
| Published | 2024-02-07 |
| First published | 2024-02-07 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 25 |
| Unpacked size | 24.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 161 |
| Maintainers | aljesusg |
| Keywords | backstage, plugin |

## Links

- npm: https://www.npmjs.com/package/@aljesusg/backstage-plugin-kiali
- Repository: https://github.com/janus-idp/backstage-plugins
- Homepage: https://janus-idp.io/
- Issues: https://github.com/janus-idp/backstage-plugins/issues
- npm.io page: https://npm.io/package/@aljesusg/backstage-plugin-kiali

## Dependencies (25)

- [axios](https://npm.io/package/axios.md) ^1.5.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [moment](https://npm.io/package/moment.md) ^2.29.4
- [history](https://npm.io/package/history.md) ^5.3.0
- [cytoscape](https://npm.io/package/cytoscape.md) 3.15.5
- [react-ace](https://npm.io/package/react-ace.md) 9.1.3
- [react-use](https://npm.io/package/react-use.md) ^17.4.0
- [typestyle](https://npm.io/package/typestyle.md) ^2.4.0
- [deep-freeze](https://npm.io/package/deep-freeze.md) 0.0.1
- [json-beautify](https://npm.io/package/json-beautify.md) 1.0.1
- [@backstage/theme](https://npm.io/package/@backstage/theme.md) ^0.4.3
- [@material-ui/lab](https://npm.io/package/@material-ui/lab.md) ^4.0.0-alpha.45
- [typesafe-actions](https://npm.io/package/typesafe-actions.md) ^4.2.1
- [@backstage/errors](https://npm.io/package/@backstage/errors.md) ^1.2.3
- [@material-ui/core](https://npm.io/package/@material-ui/core.md) ^4.9.13
- [@material-ui/icons](https://npm.io/package/@material-ui/icons.md) ^4.11.3
- [@patternfly/patternfly](https://npm.io/package/@patternfly/patternfly.md) ^5.1.0
- [@patternfly/react-core](https://npm.io/package/@patternfly/react-core.md) ^5.1.1
- [@patternfly/react-icons](https://npm.io/package/@patternfly/react-icons.md) ^5.1.1
- [react-copy-to-clipboard](https://npm.io/package/react-copy-to-clipboard.md) 5.x
- [@backstage/catalog-model](https://npm.io/package/@backstage/catalog-model.md) ^1.4.3
- [@patternfly/react-charts](https://npm.io/package/@patternfly/react-charts.md) ^7.1.1
- [@backstage/core-components](https://npm.io/package/@backstage/core-components.md) ^0.13.6
- [@backstage/core-plugin-api](https://npm.io/package/@backstage/core-plugin-api.md) ^1.7.0
- [@backstage/plugin-catalog-react](https://npm.io/package/@backstage/plugin-catalog-react.md) ^1.8.5

## Recent versions

- 1.8.5 (latest) — 2024-02-07
- 1.8.4 — 2024-02-07

## README

# Kiali plugin for Backstage

The Kiali Plugin
This plugin exposes information about your entity-specific ServiceMesh objects.

## Capabilities

The Kiali plugin has the following capabilities:

- Overview
  - Metrics by namespace
  - Health by namespace
  - Canary info
  - Istio Config warnings

## For administrators

### Setting up the Kiali plugin

#### Prerequisites

- The following annotation is added to the entity's `catalog-info.yaml` file to identify whether an entity contains the Kubernetes resources:

  ```yaml
  annotations:
    ...

    backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
  ```

  You can also add the `backstage.io/kubernetes-namespace` annotation to identify the Kubernetes resources using the defined namespace.

  ```yaml
  annotations:
    ...

    backstage.io/kubernetes-namespace: <RESOURCE_NS>
  ```

- The following annotation is added to the `catalog-info.yaml` file of entity to view the latest `PipelineRun` in the CI/CD tab of the application:

  ```yaml
  annotations:
    ...

    janus-idp.io/kiali-enabled : 'true'
  ```

- A custom label selector can be added, which Backstage uses to find the Kubernetes resources. The label selector takes precedence over the ID annotations.

  ```yaml
  annotations:
    ...

    backstage.io/kubernetes-label-selector: 'app=my-app,component=front-end'
  ```

- The following label is added to the resources so that the Kubernetes plugin gets the Kubernetes resources from the requested entity:

  ```yaml
  labels:
    ...

    backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>`
  ```

  ***

  **NOTE**

  When using the label selector, the mentioned labels must be present on the resource.

  ***

#### Procedure

1. Install the Kiali plugin using the following commands:

   ```console
   yarn workspace app add @janus-idp/backstage-plugin-kiali
   ```

2. Enable the **Kiali** tab on the entity view page using the `packages/app/src/components/catalog/EntityPage.tsx` file:

   ```tsx title="packages/app/src/components/catalog/EntityPage.tsx"
   /* highlight-add-next-line */
   import { EntityKialiContent } from '@janus-idp/backstage-plugin-kiali';

   const serviceEntityPage = (
     <EntityLayout>
       {/* ... */}
       {/* highlight-add-start */}
       <EntityLayout.Route path="/kiali" title="kiali">
         <EntityKialiContent />
       </EntityLayout.Route>
       {/* highlight-add-end */}
     </EntityLayout>
   );
   ```

3. Configure you `app-config.yaml` with kiali configuration

```yaml
catalog:
  providers:
    # highlight-add-start
    kiali:
      # Required. Kiali endpoint
      url: ${KIALI_ENDPOINT}
      # Optional. Required by token authentication
      serviceAccountToken: ${KIALI_SERVICE_ACCOUNT_TOKEN}
      # Optional. defaults false
      skipTLSVerify: true
      # Optional
      caData: ${KIALI_CONFIG_CA_DATA}
      # Optional. Local path to CA file
      caFile: ''
      # Optional. Time in seconds that session is enabled, defaults to 1 minute.
      sessionTime: 60
      # highlight-add-end
```

Authentication methods:

- anonymous [Read docs about this authentication in kiali.io](https://kiali.io/docs/configuration/authentication/anonymous/)
- token [Read docs about this authentication in kiali.io](https://kiali.io/docs/configuration/authentication/token/)

The following table describes the parameters that you can configure to enable the plugin under `catalog.providers.keycloakOrg.<ENVIRONMENT_NAME>` object in the `app-config.yaml` file:

| Name                  | Description                                                                                                          | Default Value | Required                                |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------- | --- |
| `url`                 | Location of the kIALI server, such as `https://localhost:4000`                                                       | ""            | Yes                                     |     |
| `serviceAccountToken` | Service Account Token which is used for querying data from Kiali                                                     | ""            | Yes if using token based authentication |
| `skipTLSVerify`       | Skip TLS certificate verification presented by the API server                                                        | false         | No                                      |
| `caData`              | Base64-encoded certificate authority bundle in PEM format                                                            | ""            | No                                      |
| `caFile`              | Filesystem path (on the host where the Backstage process is running) to a certificate authority bundle in PEM format | ""            | No                                      |
| `sessionTime`         | Time in seconds that session is enabled                                                                              | 60            | No                                      |

## For users

1. Open your Backstage application and select a component from the **Catalog** page.

![catalog-list](./images/catalog-list.png)

2. Check that you entity has the annotations.

![entity](./images/entity.png)

3. Go to the **Kiali** tab.

   The **Kiali** tab displays the Overview view associated to a Servicemesh.

   ![overview-tab](./images/overview_tab.png)

   There is also a **Go To Kiali Graph** option at the bottom of each card, which redirects you to the **Graph in the Kiali Standalone**.

## Development

To develop/contribute in kiali plugin follow [these instructions](./DEVELOPMENT.md)

---
_Source: https://npm.io/package/@aljesusg/backstage-plugin-kiali · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
