このコンテンツは選択した言語では利用できません。
Chapter 1. Customizing sample software templates
Learn how to customize software templates for your on-premise environment. As a cluster administrator, you have full control over modifying metadata and specifications to align with your deployment needs.
Prerequisites
Before customizing the sample software templates, ensure you have the following prerequisites in place:
- You have used the forked repository URL from the tssc-sample-templates during installation.
-
The forked
tssc-sample-templatesrepository is up to date with the upstream repository. -
You have cloned the
tssc-sample-templatesrepository to your local machine.
Procedure
-
Navigate to the cloned
tssc-sample-templatesrepository on your local machine. Open the
propertiesfile with your preferred text editor. For example, run the following command in your terminal to open it with Visual Studio Code:code properties
$ code propertiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow Customize the
propertiesfile by updating the following key-value pairs according to your environment:Expand Key Description export GITHUB_DEFAULT_HOST
Set this to your on-premise GitHub host fully qualified domain name. That is, the URL without the
HTTPprotocol and without the.gitextension. For examplegithub-github.apps.cluster-ljg9z.sandbox219.opentlc.com. The default value isgithub.com.export GITLAB_DEFAULT_HOST
Set this to your on-premise GitLab host fully qualified domain name. That is, the URL without the
HTTPprotocol and without the.gitextension. For examplegitlab-gitlab.apps.cluster-ljg9z.sandbox219.opentlc.com. The default value isgitlab.com.export DEFAULT_DEPLOYMENT_NAMESPACE_PREFIX
The namespace prefix for deployments within RHADS - SSC. The default value is
tssc-app.NoteUpdate this if you have modified the default
developerHub: namespacePrefixesduring the installation process.export PIPELINE_REPO_URL
The URL of the forked pipeline repository. For example, https://github.com/redhat-appstudio/tssc-sample-pipelines.
export PIPELINE_REPO_BRANCH
The target branch of the forked pipeline repository. For example,
main.export GITHUB_DEFAULT_ORG
The name of the GitHub organization that you want to set as the default.
export QUAY_DEFAULT_ORG
The name of the Quay organization that you want to set as the default.
Adjust the software templates, replacing default host values with your specified inputs by running the following command from the top-level directory of the repository:
./generate.sh
$ ./generate.shCopy to Clipboard Copied! Toggle word wrap Toggle overflow For Jenkins only
If your Jenkins instance is not deployed to an on-premise OpenShift Container Platform (OCP) instance, and your Rekor and TUF services are on different clusters, update the
REKOR_HOSTandTUF_MIRRORenvironment variables. You can configure these variables in the env.sh file within the component repository or set them as environment variables or secrets in Jenkins.This configuration ensures that the external Jenkins server can communicate with the Rekor and TUF services installed with RHADS - SSC. Without this customization, RHADS - SSC might not sign the container images correctly in the Jenkins pipeline.
To update the
REKOR_HOSTandTUF_MIRRORvariables:Open the env.sh file by navigating to the skeleton > ci > gitops-template > jenkins > tssc directory.
The second env.sh file is located at skeleton > ci > source-repo > jenkins > tssc. Update the settings to suit your needs.
In env.sh, review the default values for
REKOR_HOSTandTUF_MIRROR:REKOR_HOST=http://rekor-server.tssc-tas.svc TUF_MIRROR=http://tuf.tssc-tas.svc
REKOR_HOST=http://rekor-server.tssc-tas.svc TUF_MIRROR=http://tuf.tssc-tas.svcCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace
.svcwith your OCP cluster URL. The.svcdomain refers to the local cluster, and internal services can access other services with.svcin their routes, but an external Jenkins cannot.The correct routes of the Rekor and TUF services are printed as part of the installation process of RHADS - SSC. If these data aren’t available to you, run this command in your CLI and select the Rekor and TUF routes in the output:
oc get routes -n tssc-tas
$ oc get routes -n tssc-tasCopy to Clipboard Copied! Toggle word wrap Toggle overflow An example of a Rekor server URL: http://rekor-server.tssc-tas.apps.rosa.j6ufg-t3htv-ts6.z797.p3.openshiftapps.com.
Note- To configure environment variables or secrets in Jenkins see, Adding secrets to Jenkins for secure integration with external tools.
-
For Red Hat Advanced Cluster Security (RHACS) only: To enable RHACS scans, set the
export DISABLE_ACStofalsein the env.sh file. - Option A: Commit and push the changes to your repository. This automatically updates the template in Red Hat Developer Hub (RHDH).
Option B: Manually import and refresh the templates using the following steps:
- Go to your forked sample template repository on your Git provider.
Get the appropriate URL:
-
For a single template, from the
templatesdirectory, 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. -
For all templates, select
all.yamland copy its URL from the browser address bar. For example,https://github.com/username/tssc-sample-templates/blob/main/all.yaml.
-
For a single template, from the
- Switch back to the RHDH platform.
- Select Create > Register Existing Component.
- In the Select URL field, paste the appropriate URL that you copied in the previous step.
- 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.