Este contenido no está disponible en el idioma seleccionado.
Chapter 6. Enabling the Tekton plugin
You can use the Tekton plugin to visualize the results of CI/CD pipeline runs on your Kubernetes or OpenShift clusters. The plugin allows users to visually see high level status of all associated tasks in the pipeline for their applications.
Prerequisites
-
You have installed and configured the
@backstage/plugin-kubernetes
and@backstage/plugin-kubernetes-backend
dynamic plugins. -
You have configured the Kubernetes plugin to connect to the cluster using a
ServiceAccount
. The
ClusterRole
must be granted for custom resources (PipelineRuns and TaskRuns) to theServiceAccount
accessing the cluster.NoteIf you have the RHDH Kubernetes plugin configured, then the
ClusterRole
is already granted.-
To view the pod logs, you have granted permissions for
pods/log
. You can use the following code to grant the
ClusterRole
for custom resources and pod logs:Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can use the prepared manifest for a read-only
ClusterRole
, which provides access for both Kubernetes plugin and Tekton plugin.Add the following annotation 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>
annotations: ... backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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>
annotations: ... backstage.io/kubernetes-namespace: <RESOURCE_NS>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following annotation to the
catalog-info.yaml
file of the entity to enable the Tekton related features in RHDH. The value of the annotation identifies the name of the RHDH entity:annotations: ... janus-idp.io/tekton : <BACKSTAGE_ENTITY_NAME>
annotations: ... janus-idp.io/tekton : <BACKSTAGE_ENTITY_NAME>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a custom label selector, which RHDH 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'
annotations: ... backstage.io/kubernetes-label-selector: 'app=my-app,component=front-end'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following label to the resources so that the Kubernetes plugin gets the Kubernetes resources from the requested entity:
labels: ... backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
labels: ... backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWhen you use the label selector, the mentioned labels must be present on the resource.
Procedure
The Tekton plugin is pre-loaded in RHDH with basic configuration properties. To enable it, set the disabled property to false as follows:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow