Questo contenuto non è disponibile nella lingua selezionata.
Chapter 6. Installing and configuring 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.
6.1. Installation Copia collegamentoCollegamento copiato negli appunti!
Prerequisites
-
You have installed and configured the
@backstage/plugin-kubernetesand@backstage/plugin-kubernetes-backenddynamic plugins. -
You have configured the Kubernetes plugin to connect to the cluster using a
ServiceAccount. The
ClusterRolemust be granted for custom resources (PipelineRuns and TaskRuns) to theServiceAccountaccessing the cluster.NoteIf you have the RHDH Kubernetes plugin configured, then the
ClusterRoleis already granted.-
To view the pod logs, you have granted permissions for
pods/log. You can use the following code to grant the
ClusterRolefor 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.yamlfile 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-namespaceannotation 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.yamlfile 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