Chapter 1. Customizing sample software templates
Learn how to customize ready-to-use software templates for your on-prem environment. Cluster administrators have full control over this process, including modifying metadata and specifications.
Prerequisites
- You have used the forked repository URL from tssc-sample-templates during the RHTAP install process.
Procedure
- Clone your forked repository, and then open it in your preferred text editor, such as Visual Studio Code.
Locate the properties file within your project directory. This file stores the default values that can customize. Open it for editing and update the following key-value pairs according to your environment.
Key Description export GITHUB_DEFAULT_HOST
Set this to your on-prem GitHub host fully qualified domain name. That is, the URL without the
HTTP
protocol and without the.git
extension. For example github-github.apps.cluster-ljg9z.sandbox219.opentlc.com. Default isgithub.com
.export GITLAB_DEFAULT_HOST
Set this to your on-prem GitLab host host fully qualified domain name. That is, the URL without the
HTTP
protocol and without the.git
extension. For example gitlab-gitlab.apps.cluster-ljg9z.sandbox219.opentlc.com. Default isgitlab.com
.export QUAY_DEFAULT_HOST
The default Quay URL correspond to your specific on-prem image registry URL without the
HTTP
protocol. For example, quay-tv2pb.apps.cluster-tv2pb.sandbox1194.opentlc.com. The default quay host isquay.io
.export DEFAULT_DEPLOYMENT_NAMESPACE_PREFIX
The namespace prefix for deployments within RHTAP. Default is
rhtap-app
.NoteUpdate this if you have modified the default
trusted-application-pipeline: namespace
during the RHTAP installation process.Figure 1.1. The properties file
Run the generate.sh script in your terminal. This action adjusts the software templates, replacing default host values with your specified inputs.
./generate.sh
Figure 1.2. The generate.sh script
Commit and push the changes to your repository. This automatically updates the template in RHDH. Alternatively, you can import and refresh a single or all customized templates directly in RHDH.
- Go to your forked sample template repository on your Git provider.
-
For a single template, from the
templates
directory, select selecttemplate.yaml
. Copy its URL from the browser address bar. For example, https://github.com/<username>/tssc-sample-templates/blob/main/templates/devfile-sample-code-with-quarkus-dance/template.yaml. Otherwise, for all the templates, selectall.yaml
and copy its URL from the browser address bar. For example, https://github.com/<username>/tssc-sample-templates/blob/main/all.yaml. - Switch back to RHDH platform.
- Select Create > Register Existing Component.
- In the Select URL field, paste the appropriate URL that you copied in Step 4b.
- Select Analyze and then select Import to update the templates in RHDH.
Verification
- Consider creating an application to explore the impact of your template customization.
Additional resources
- To customize pipelines, see Customizing sample pipeline templates