Understanding KDE Templates: Creation, Onboarding and Usage
8 min
adrian doroiman associate director, software architecture tldr for quick links more generic information about backstage templates is in the main body of this page scaffolder templates https //pages github kyndryl net/kde universe/gemu ghes templates/ template repository https //github kyndryl net/kde universe/gemu ghes templates custom actions repository https //github kyndryl net/kyndryl idp/kyndryl idp app/tree/develop/plugins/scaffolder backend module fetch bu manager/src/actions custom ui fields repository https //github kyndryl net/kyndryl idp/kyndryl idp app/tree/develop/packages/app/src/components/template contents introduction https //kyndryl sharepoint com/sites/kde developer experience/sitepages/understanding kde templates creation, onboarding and usage aspx#introduction to kde templates prerequisites https //kyndryl sharepoint com/sites/kde developer experience/sitepages/understanding kde templates creation, onboarding and usage aspx#prerequisites for creating a new kde template template structure https //kyndryl sharepoint com/sites/kde developer experience/sitepages/understanding kde templates creation, onboarding and usage aspx#template structure 1 onboarding process https //kyndryl sharepoint com/sites/kde developer experience/sitepages/understanding kde templates creation, onboarding and usage aspx#onboarding a template into kde how to use a new template https //kyndryl sharepoint com/sites/kde developer experience/sitepages/understanding kde templates creation, onboarding and usage aspx#step by step guide to using a newly onboarded kde template best practices https //kyndryl sharepoint com/sites/kde developer experience/sitepages/understanding kde templates creation, onboarding and usage aspx#best practices and troubleshooting tips introduction to kde templates kde templates are a foundational component within the backstage developer portal which kde uses as a framework, designed to standardize and accelerate the creation of new software components, services, or resources by leveraging templates, organizations can ensure consistency, enforce best practices, and streamline onboarding for new projects or teams a kde template defines a repeatable process for generating new entities—such as microservices, libraries, or documentation sites—based on predefined configurations and scaffolding logic this approach not only reduces manual setup time but also helps maintain compliance with architectural and operational standards across the organization templates are typically authored in yaml and can include input parameters, validation rules, and automation steps when a user initiates a template, backstage guides them through a form driven workflow, collects the necessary information, and then executes the template logic to provision the new resource prerequisites for creating a new kde template before creating a new kde template, it is important to ensure that certain prerequisites are met to facilitate a smooth and effective template development process access to a kde instance you must have access to a running kde instance with the necessary permissions to add or modify templates familiarity with yaml backstage templates are typically defined in yaml format understanding yaml syntax is essential for authoring and configuring templates knowledge of organizational standards be aware of kyndryl’s best practices, naming conventions, and compliance requirements to ensure the template aligns with internal guidelines source code repository a github repository is required to store and manage the template files and any associated scaffolding logic template inputs and outputs clearly define the parameters and expected outputs for the template to ensure it meets the intended use cases testing environment access to a test environment is recommended for validating the template before deploying it to production template structure when starting development of a new template, the minimum that is required is a template yaml file a simple template yaml definition is shown below apiversion scaffolder backstage io/v1beta3 kind template \# some metadata about the template itself metadata name v1beta3 demo title test action template description scaffolder v1beta3 template demo spec owner backstage/techdocs core type service # these are the steps which are rendered in the frontend with the form input parameters title fill in some steps required name properties name title name type string description unique name of the component ui\ autofocus true ui\ options rows 5 title choose a location required repourl properties repourl title repository location type string ui\ field repourlpicker ui\ options allowedhosts github com # here are the steps that are executed in series in the scaffolder backend steps id fetch base name fetch base action fetch\ template input url /template values name ${{ parameters name }} id fetch docs name fetch docs action fetch\ plain input targetpath /community url https //github com/backstage/community/tree/main/backstage community sessions id publish name publish action publish\ github input description this is ${{ parameters name }} repourl ${{ parameters repourl }} defaultbranch 'main' id register name register action catalog\ register input repocontentsurl ${{ steps\['publish'] output repocontentsurl }} cataloginfopath '/catalog info yaml' onboarding a template into kde onboarding a template into backstage involves registering the template so it becomes available for use within the backstage developer portal this process ensures that the template is discoverable, properly configured, and ready to be used by teams to scaffold new projects or resources template registration add the template’s yaml definition to the kde catalog, typically by placing the template file in a version controlled repository and referencing its location in the kde configuration catalog refresh trigger a catalog refresh or reload so kde detects and indexes the new template this step makes the template visible in the software templates section of the portal template metadata ensure the template includes all required metadata, such as name, description, owner, and input parameters this information helps users identify and select the appropriate template for their needs validation and testing before making the template broadly available, test it in a staging or development environment to confirm that it works as intended and aligns with organizational standards documentation provide clear documentation and usage instructions, either embedded within the template or as a separate resource, to guide users through the template’s workflow and requirements once onboarded, the template can be used by teams to quickly and consistently generate new components, ensuring alignment with best practices and reducing manual setup effort step by step guide to using a newly onboarded kde template applying a new kde template involves a series of guided steps within the kde portal the process is designed to be intuitive and ensures that all necessary information is collected and validated before the template is executed access the component creation page navigate to the software templates section, typically available at /create in your kde instance for local development, this is often http //localhost 3000/create select a template browse the available templates and choose the one that matches your intended use case each template may have a unique set of input requirements provide input variables fill in the required variables as prompted these may include project name, description, owner, and other parameters specific to the template specify backstage metadata enter additional fields required for kde usage, such as the owner run the template after confirming all inputs, initiate the component creation process a live progress popup will display the status of each step if any step fails, you can review logs for troubleshooting cancel if needed you can cancel the process at any time if you do, an abort signal is sent, and subsequent steps will not be executed the current step will only be cancelled if supported view the created component once the template completes successfully, use the "view in catalog" button to access the newly registered component in the backstage catalog this workflow ensures that new components are created efficiently, with all necessary metadata and organizational standards applied from the outset best practices and troubleshooting tips adhering to best practices when working with backstage templates ensures a smooth experience for both template authors and users additionally, being aware of common troubleshooting steps can help resolve issues quickly and maintain template reliability keep templates modular design templates to be modular and reusable, allowing teams to adapt them for various use cases without duplicating logic document inputs and outputs clearly document all required input parameters and expected outputs within the template and supporting documentation to minimize user confusion validate early and often use validation rules in the template to catch missing or incorrect input values before execution begins test in a development environment always test new or updated templates in a non production environment to ensure they function as intended and comply with organizational standards version control store templates in a version controlled repository to track changes, facilitate collaboration, and enable rollback if issues arise by convention, you should store each template in its own repository monitor execution logs encourage users to review execution logs for each template run logs provide valuable insights into failures and can help pinpoint the root cause of issues provide troubleshooting guidance maintain a troubleshooting guide that addresses common errors, such as missing permissions, incorrect repository urls, or failed automation steps engage with the community participate in the backstage community forums and discussions to stay updated on best practices, new features, and solutions to common challenges