- Identify the resources that make up the voting app (Secrets, BuildConfigs, ImageStreams, DeploymentConfigs, Services, Routes).
- Export and clean each resource’s YAML, then assemble them under the Template’s
objects:array. - Create the Template in a project and add it to the catalog.
- Optionally parameterize values so the catalog wizard prompts users for inputs.
Recommended SEO keywords: OpenShift Template, custom catalog, example voting app, BuildConfig, ImageStream, DeploymentConfig, Route, Secrets.
1. Create the Template file
Create a file namedexample-voting-app-template.yml. Start with the Template API version, kind, and metadata. Use openshift.io/display-name as an annotation if you want a friendly label to appear in the catalog.
objects array will contain a list of resource manifests (each item prefixed with -). Populate this array with cleaned YAML documents for Secrets, BuildConfigs, ImageStreams, DeploymentConfigs, Services, and Routes.
2. Secrets
Start with Secrets because multiple components reference DB and Redis credentials. In the OpenShift Console, open each Secret → Actions → Edit YAML and copy it into the template. Remove runtime metadata fields such ascreationTimestamp, resourceVersion, uid, selfLink, and status.
Use stringData in the template for clear-text values so users (or parameters) can provide plaintext values which the API converts to base64.
Example cleaned DB Secret entry to include under objects::

3. BuildConfigs
Export each BuildConfig from the project, then remove unnecessary metadata andstatus. Keep the spec (source Git repo, contextDir, build strategy, triggers, environment variables, etc.). Consider parameterizing the Git URL and branch.
Example cleaned BuildConfig for the result app:
vote and worker BuildConfigs, adjusting contextDir and labels.
4. ImageStreams
Include ImageStream resources so OpenShift can resolve image references and trigger rebuilds/rollouts. Keep the name and the minimal spec required.5. DeploymentConfigs
Export and clean DeploymentConfig resources, removingstatus and runtime metadata while preserving spec. Keep container images, environment variables (use valueFrom.secretKeyRef for secrets), probes, resource limits, and ports.
Example db DeploymentConfig entry:
vote, result, worker, and redis DeploymentConfigs.
6. Services and Routes
Add Service objects for in-cluster networking. Theworker service is optional if nothing targets it, but including it maintains consistency.
Example Service for worker:

result, vote, and db. Then add Route objects for vote and result so they are reachable externally.
7. Create the Template in OpenShift (CLI)
When yourexample-voting-app-template.yml is complete, create it in a project where you have permission (for example voting-application-3). If you attempt to create it in the default namespace as a normal user, you’ll get a Forbidden error.
If you run
oc create -f without specifying a project and you are not a cluster admin, OpenShift will likely reject the request. Always target a project/namespace where you have permission, e.g. -n voting-application-3.example-voting-app-template should appear. Click it and run the wizard to deploy the voting stack.
8. Monitoring the deployment
Open the Overview / Monitoring page to watch builds, pods, and events as the application starts. Allow builds and pods time to finish, then open thevote and result routes to verify front-ends.

9. Improve the Template (best practices)
To make the Template friendly and reusable:- Parameterize values that are likely to change: Git repository URL, branch/ref, image tag, project namespace, database credentials.
- Add
parameters:entries at the top-level of the Template withname,displayName,description,required, andvalueso the catalog wizard asks for them. - Avoid embedding plaintext credentials in the template. Use
stringDatawith parameters or let users supply secrets during the wizard. - Provide helpful
annotationsandlabels(for display name, description, and categorization in the catalog).
Tip: Use Template parameters for values that change often (git repo, branch, image tag, database credentials). Parameters allow the catalog wizard to prompt users instead of requiring manual file edits.
That completes this lesson on creating a custom catalog template for the Example Voting Application. You now have the steps to export, clean, assemble, and publish an OpenShift Template so others can deploy the full application stack from the catalog. Thank you.