Este contenido no está disponible en el idioma seleccionado.

Tekton plugin for Backstage


Red Hat Plug-ins for Backstage 1.0

The Tekton plugin for Backstage

Red Hat Customer Content Services

Abstract

The Tekton plugin enables you to visualize the PipelineRun resources available on the Kubernetes cluster.

Chapter 1. Tekton plugin for Backstage

The Tekton plugin enables you to visualize the PipelineRun resources available on the Kubernetes cluster.

1.1. For administrators

1.1.1. Setting up the Tekton plugin

The Red Hat Plug-ins for Backstage (RHPIB) packages are hosted in a separate NPM registry, which is maintained by Red Hat. To use the RHPIB NPM packages, you must adjust your NPM configuration. You can create a .npmrc file, containing the following content:

@redhat:registry=https://npm.registry.redhat.com/ registry=https://registry.npmjs.org

For more information, see npm docs.

Creating a .npmrc file ensures that all the packages are scoped under @redhat and are fetched from Red Hat’s NPM registry, while the rest dependencies remain sourced from other registry.

Using this configuration, you can proceed with the installation of the individual packages.

Prerequisites

  • The Kubernetes plugins including @backstage/plugin-kubernetes and @backstage/plugin-kubernetes-backend are installed and configured by following the installation and configuration guides.
  • The following customResources component is added in the app-config.yaml file:

       kubernetes:
         ...
         customResources:
           - group: 'tekton.dev'
             apiVersion: 'v1beta1'
             plural: 'pipelineruns'
           - group: 'tekton.dev'
             apiVersion: 'v1beta1'
             plural: 'taskruns'
    Copy to Clipboard Toggle word wrap
  • The Kubernetes plugin is configured and connects to the cluster using a ServiceAccount.
  • The ClusterRole must be granted for custom resources (PipelineRuns and TaskRuns) to ServiceAccount accessing the cluster. If you have the Backstage Kubernetes Plugin configured, then the ClusterRole is already granted.

    You can use the following code to grant the ClusterRole for custom resources:

        ...
        apiVersion: rbac.authorization.k8s.io/v1
        kind: ClusterRole
        metadata:
          name: backstage-read-only
        rules:
          ...
          - apiGroups:
              - tekton.dev
            resources:
              - pipelineruns
              - taskruns
            verbs:
              - get
              - list
    Copy to Clipboard Toggle word wrap
  • The following annotation is added to the entity’s catalog-info.yaml file to identify whether an entity contains the Kubernetes resources:

      annotations:
        ...
    
        backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
    Copy to Clipboard Toggle word wrap

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

      annotations:
        ...
    
        backstage.io/kubernetes-namespace: <RESOURCE_NS>
    Copy to Clipboard Toggle word wrap
  • 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:

      annotations:
        ...
    
        janus-idp.io/tekton-enabled : 'true'
    Copy to Clipboard Toggle word wrap
  • A custom label selector can be added, which Backstage uses to find the Kubernetes resources. The label selector takes precedence over the ID annotations.

      annotations:
        ...
    
        backstage.io/kubernetes-label-selector: 'app=my-app,component=front-end'
    Copy to Clipboard Toggle word wrap
  • The following label is added to the resources so that the Kubernetes plugin gets the Kubernetes resources from the requested entity:

      labels:
        ...
    
        backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>`
    Copy to Clipboard Toggle word wrap
Note

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

Procedure

  1. Install the Tekton plugin using the following command:

    yarn workspace app add @redhat/backstage-plugin-tekton
    Copy to Clipboard Toggle word wrap
  2. Enable the TEKTON 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 { TektonPage } from '@redhat/backstage-plugin-tekton';
    
       const serviceEntityPage = (
         <EntityPageLayout>
           {/* ... */}
           {/* highlight-add-start */}
           <EntityLayout.Route path="/tekton" title="Tekton">
             <TektonPage />
           </EntityLayout.Route>
           {/* highlight-add-end */}
         </EntityPageLayout>
       );
    Copy to Clipboard Toggle word wrap
  3. Enable latest PipelineRun visualization in the CI/CD tab on the entity view page. The linkTekton property is optional and takes boolean value, if not specified or set to true, then the GO TO TEKTON option is displayed.

       ```tsx title="packages/app/src/components/catalog/EntityPage.tsx"
       /* highlight-add-next-line */
       import { LatestPipelineRun, isTektonCIAvailable } from '@redhat/backstage-plugin-tekton';
    
       const cicdContent = (
         <EntitySwitch>>
           {/* ... */}
           {/* highlight-add-start */}
           <EntitySwitch.Case if={isTektonCIAvailable}>
             <LatestPipelineRun linkTekton />
           </EntitySwitch.Case>
           {/* highlight-add-end */}
         </EntitySwitch>
       );
       ```
    Copy to Clipboard Toggle word wrap

1.2. For users

1.2.1. Using the Tekton plugin in Backstage

Tekton is a front-end plugin that enables you to view the PipelineRun resources.

Prerequisites

  • Your Backstage application is installed and running.
  • You have installed the Tekton plugin. For the installation process, see Setting up the Tekton plugin.

Procedure

  1. Open your Backstage application and select a component from the Catalog page.
  2. Go to the CI/CD tab.

    The CI/CD tab displays the latest PipelineRun resources associated to a Kubernetes cluster. The resources include tasks to complete. When you hover the mouse pointer on a task card, you can view the steps to complete that particular task.

    There is also a GO TO TEKTON option at the bottom, which redirects you to the TEKTON tab.

  3. Click GO TO TEKTON or select the TEKTON tab in the entity view page.

    The TEKTON tab contains the list of pipeline runs related to a cluster. The list contains pipeline run details, such as NAME, STATUS, TASK STATUS, STARTED, and DURATION.

Legal Notice

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat