Add custom plugins in IDP
Learn about the steps to add your custom plugin in IDP.
In IDP we allow addition of, backstage frontend plugins, created by you as a custom plugin. Following are the step-by-step instructions to add your custom plugins in IDP.
Go to Plugins under Configure section.
Now you could find the Custom Plugins tab on the Plugins page.
Start by creating a New Custom Plugin
Add/Upload a new plugin
Now add the URL for your plugin public npm package.
eg,. https://www.npmjs.com/package/@parsifal-m/plugin-dev-quotes-homepage, https://www.npmjs.com/package/backstage-plugin-should-i-deploy
You can as well pack your backstage frontend plugins using yarn pack and upload the resulting
package.tgzfile
Only files packaged using yarn pack is to be used while uploading the zip file.
Plugin metadata
Now Click Next and start adding the Plugin Metadata. You have to fill the following fields
Plugin Name : Add a name for your Plugin
Package name : This will be same as your plugin package present in your plugin's
package.jsonfile. Make sure the name is exactly similar to what is mentioned in thepackage.jsonincluding@, e.g.:@parsifal-m/plugin-dev-quotes-homepageDescription : Add an apt description for your plugin, especially the function of the plugin.
Category : Add an functional category for your plugin like
Monitoring,Observability,CI/CDetc.Created By : Add the User Group you belong to from the dropdown.
Plugin applies to entity : Add the software components to which your plugin applies to usually it is Service.
Add Plugin Screenshots (optional) : Not available yet
Additional fields : Fill it as shown in the image below.
Layout
Now click next and Add Layout for your plugin. You have 3 categories in this and the layout is sourced from
packages/app/src/components/Catalog/EntityPage.tsx. Below are the examples.
Card: Here is an example
EntityLinksCardof Links card on Overview page.Tab: Here is an example
EntityHarnessCiCdContentof Harness CI/CD tab.Menu Item in SideNav: Here is an example of TODO plugin in side nav.
Conditional: Here is an example of the Harness CI/CD plugin, also conditional is required if you want to check for the annotations in
catalog-info.yamlin case of absence of adequate annotation required the plugin will not show up for the particular software component.
Configurations
CSP ENFORCEMENT: USE THE BACKEND PROXY FOR EXTERNAL CALLS
Due to Content Security Policy (CSP) enforcement, direct calls to external endpoints from custom plugins will be blocked. Use the Backend Proxy instead to communicate with external endpoints.
Now Click Next and go to the Configurations Page by default configuration is disabled.
If your plugin does not require any configuration settings like Proxy or authentication for API you can go ahead and enable the plugin directly.
If you require
app-config.yamlfor your plugin, then enable configuration.
Now add the proxy part here, as given below in the example,
Suppose this is the proxy configuration we define in our frontend proxy plugin:
This configuration creates a proxy endpoint in IDP.
targetdefines the destination server where the request will be proxies.pathRewriteis used to remove or replace parts of the path in the request URL. When a request is made tohttps://idp.harness.io/<ACCOUNT_ID>/idp/api/proxy/github-api/<path>, the following happens:
The target setting modifies the base URL, transforming
https://idp.harness.io/<ACCOUNT_ID>/idp/api/proxy/github-api/<path>intohttps://api.github.com/api/proxy/github-api/<path>.pathRewritereplaces/api/proxy/github-api/with/, so the URL transforms fromhttps://api.github.com/api/proxy/github-api/<path>tohttps://api.github.com/<path>.Now in the above proxy authorization is added as a variable
SECRET_TOKENand the secret is stored in Harness Secret manager.You can as well access any private URLs/PORT if required by your plugin and that is behind any firewalls using Harness Delegate.
Now Enable the Plugin.
Once the plugin is Enabled, to add it in your Sidenav as shown in the image go to the Layout under Configure.
For card based plugin update for Service under the
overviewand add thecomponentsfor the custom plugin undercontentsas shown below.
For tab based plugin you can update the
componentname under Service or any other pages.For Full Page Plugin Under the Sidenav configuration, add the plugin name as a
SidebarItemwith reference to your pluginto: component nameunderprops. Read more about [Configuring Layout of IDP Catalog pages](Configuring Layout of IDP Catalog pages).
Edit/Delete plugin
Once your Plugin is enabled you can find the plugin under Enabled Plugin tab as well as under Custom Plugin tab with Enabled tag, but you can edit or delete plugin only under custom plugins tab. Now click on the 3 dots at top of the Plugin card to edit or delete plugin.
Last updated
Was this helpful?