1.4.4 • Published 7 days ago

@janus-idp/backstage-plugin-web-terminal v1.4.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
7 days ago

Web Terminal plugin for Backstage

This plugin provides a frontend for webterminal proxy and shows a terminal for catalog entities with an Kubernetes API-Server annotation (kubernetes.io/api-server).

Users first enter their user token from the cluster, and then the plugin setups environment. Once it is set up, it connects to webterminal-proxy, which finishes setups and passes data between the frontend plugin and pod.

This plugin uses xterm.js to simulate a regular terminal.

Prerequisites

Before we can install this plugin, we need to fulfill the following requirements:

  1. Installed Web Terminal operator
  2. Deployed webterminal-proxy

Installation

  1. Install the Web Terminal plugin using the following command:

    yarn workspace app add @janus-idp/backstage-plugin-web-terminal
  2. Enable an additional tab on the entity view page using the packages/app/src/components/catalog/EntityPage.tsx file as follows:

    /* highlight-add-start */
    import {
      isWebTerminalAvailable,
      WebTerminal,
    } from '@janus-idp/backstage-plugin-web-terminal';
    
    /* highlight-add-end */
    
    const serviceEntityPage = (
      <EntityLayout>
        // ...
        {/* highlight-add-start */}
        <EntityLayout.Route
          if={isWebTerminalAvailable}
          path="/webterminal"
          title="Web Terminal"
        >
          <WebTerminal />
        </EntityLayout.Route>
        {/* highlight-add-end */}
      </EntityLayout>
    );
  3. Alternative you can add the WebTerminal to an existing page:

    /* highlight-add-start */
    import {
      isWebTerminalAvailable,
      WebTerminal,
    } from '@janus-idp/backstage-plugin-web-terminal';
    
    /* highlight-add-end */
    
    <Grid container spacing={3}>
      {/* highlight-add-start */}
      <EntitySwitch>
        <EntitySwitch.Case if={isWebTerminalAvailable}>
          <Grid item md={6}>
            <WebTerminal />
          </Grid>
        </EntitySwitch.Case>
      </EntitySwitch>
      {/* highlight-add-end */}
    </Grid>;
  4. Annotate your entity using the following annotations:

    metadata:
      annotations:
        'kubernetes.io/api-server': `<CLUSTER-URL>',

Configuration

You have to define the location of the webterminal-proxy in app-config.yaml:

webTerminal:
  webSocketUrl: 'wss://example.com:3000/webterminal'
  restServerUrl: 'https://example.com:3000/webterminal/rest'

Optionally, you can also define the default namespace for the terminal; otherwise, openshift-terminal will be used:

webTerminal:
  webSocketUrl: 'wss://example.com:3000/webterminal'
  restServerUrl: 'https://example.com:3000/webterminal/rest'
  defaultNamespace: 'default'
1.4.4

7 days ago

1.4.3

7 days ago

1.4.2

9 days ago

1.4.1

9 days ago

1.4.0

24 days ago

1.3.11

1 month ago

1.3.12

1 month ago

1.3.10

1 month ago

1.3.9

1 month ago

1.3.8

1 month ago

1.3.7

2 months ago

1.3.6

2 months ago

1.3.5

2 months ago

1.3.4

3 months ago

1.3.3

3 months ago

1.3.2

3 months ago

1.3.1

4 months ago

1.3.0

4 months ago

1.2.12

5 months ago

1.2.11

5 months ago

1.2.0

6 months ago

1.1.1

8 months ago

1.1.0

9 months ago

1.2.8

6 months ago

1.2.7

6 months ago

1.2.6

6 months ago

1.2.5

6 months ago

1.2.4

6 months ago

1.2.3

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.1.2

7 months ago

1.0.3

10 months ago

1.2.9

6 months ago

1.2.10

5 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago