Platform Engineer Activity: Setup Software Templates to Import Existing API/Apps
The Platform Engineering team creates two Templates for importing existing applications/services, and APIs into Red Hat Developer Hub. While it is possible to use the same template to import both of them, there are some key differences in the data that must be gathered.
Please make sure to log in as a Platform Engineer with pe1 / {common_password} . Refer to the below guide for assistance.
|
Click to learn how to login as a Platform Engineer
Login as Platform Engineer
You will perform this activity as a Platform Engineer. Please follow the below steps to logout from Red Hat Developer Hub and GitLab, and login back as a Platform Engineer (pe1
/ {common_password}
)
-
Logout from Red Hat Developer Hub
-
Sign out of Red Hat Developer Hub from the Profile dropdown as shown in the screenshot below.
-
-
Logout from GitLab
-
Click on the Profile icon, and Sign out from the dropdown as shown in the screenshot below.
-
-
Login back as a Platform Engineer to Red Hat Developer Hub and GitLab using the credentials
pe1
/{common_password}
Register the Import Software Templates
Software Template Overview
You learned how to create Software Templates in module 3. In this section we will walk through a Template that has been pre-built for you.
The import-existing-api Software Template you’ll be using is available in the import-existing-api-template/template.yaml file in GitLab
This template does the following:
-
Gather details of the API (GitLab org name, repo name) as template parameters.
-
Gather details of the new Component to be created (Git repository for the Component, the catalog info, OpenAPI file location etc.)
-
Creates a Merge Request to create the new catalog-info.yaml and TechDocs files, which will register the Component in the Software Catalog once merged.
Register the Import API Software Template
-
Access Red Hat Developer Hub (click here). If prompted login using
pe1
/{common_password}
-
Select the
icon on the top navigation bar to access the Create menu.
-
Click on the Register Existing Component button on the top-right of the page to launch the Register an existing component wizard.
-
Paste the following URL into the Select URL field and click on Analyze button. This URL points to Software Template’s template.yaml file.
https://gitlab-gitlab.{openshift_cluster_ingress_domain}/rhdh/import-existing-api-template/-/blob/main/template.yaml
-
Review, and import the template by clicking on the Import button.
-
The import-api-catalog Template is successfully registered.
Register Import App Software Template
-
Let us now register the Import existing application template as well.
-
Click on Register another button from the previous step;
-
If that is not accessible anymore, select the
icon on the top navigation bar to access the Create menu, and then choose Register Existing Component (top right)
-
-
Paste the following URL:
https://gitlab-gitlab.{openshift_cluster_ingress_domain}/rhdh/import-existing-app-template/-/blob/main/template.yaml
-
Review and import the template by clicking on the Import button
View the Imported Templates
Navigate to the Create screen. You should see both the templates for importing APIs and applications to Red Hat Developer Hub.

Setup GitLab Entity Auto-Discovery
The new templates require a set of dynamic plugins to function detect the newly created Entities:
-
backstage-plugin-catalog-backend-module-gitlab-dynamic to enable auto-discovery of
catalog-info.yaml
files. -
immobiliarelabs-backstage-plugin to create Merge Requests using the GitLab API.
Enable the Plugins
-
You will also enable a couple of Community plugins which will help view Merge requests and Issues from GitLab
-
Visit your rhdh/developer-hub-config repository on GitLab. If prompted, login with
pe1
/{common_password}
. -
You should already be in Edit mode of the
values.yaml
file. -
Locate the comment
--- DYNAMIC_PLUGINS_IMPORT_COMPONENTS ---
-
Highlight the YAML section shown in the below screenshot, and uncomment those lines. Use
CMD + /
orCTRL + /
to do so. -
Don’t commit the changes yet - you need to also enable auto-discovery.
Enable Auto-Discovery
-
Locate the comment
--- AUTO_DISCOVERY_IMPORT_COMPONENTS ---
in the samevalues.yaml
file. -
Highlight the YAML as shown in the below screenshot, and uncomment those lines.
This YAML snippet enables auto-discovery for all files named all-location.yaml (entityFilename) where the repo name starts with the word all-location (projectPattern). -
Scroll down and enter a commit message
feat: Enable GitLab plugin and component auto discovery
. -
Commit the file now using the Commit Changes button at the bottom of the page.
-
Refresh the
backstage
Application to rollout the new Red Hat Developer Hub configuration - login asadmin
/{openshift_gitops_password}
. Wait until the Application turns green and marked as Healthy.
Onboard Parasol’s System and Domain
In a previous chapter you learned how System and Domain Entities help organize and provide a hierarchy of Components in Red Hat Developer Hub. In this section you will setup Parasol’s System and Domain.
-
From Red Hat Developer Hub, navigate to Create screen; choose Register Existing Component button
-
Paste the below URL and click on Analyze
https://gitlab-gitlab.{openshift_cluster_ingress_domain}/rhdh/rhdh-entities/-/blob/main/locations.yaml
-
Click Import in the Review section.
-
The Systems and Domain are setup.
Systems are the basic level of encapsulation for related entities. Domains are useful to group a collection of Systems that share terminology, domain models, business purpose etc. |