Adding the Default Image Streams and Templates

    You are viewing documentation for a release that is no longer supported. The latest supported version of version 3 is [3.11]. For the most recent version 4, see

    You can populate your OKD installation with useful sets of Red Hat-provided image streams and to make it easy for developers to create new applications. By default, the cluster installation process automatically creates these sets in the openshift project, which is a default project to which all users have view access.

    Image streams and templates are provided for the following technologies:

    Before You Begin

    Before you consider performing the tasks in this topic, confirm if these image streams and templates are already registered in your OKD cluster by doing one of the following:

    • Log into the web console and click Add to Project.

    • List them for the openshift project using the CLI:

    If you used a method other than the standard cluster installation process, or if the default image streams and templates are ever removed or changed, you can follow this topic to create the default objects yourself. Otherwise, the following instructions are not necessary.

    Before you can create the default image streams and templates:

    • You must be able to run the command with , because they operate on the default openshift project.

    • You must have cloned the that contains the default image streams and templates:

      1. $ cd ~
    • Define shell variables for the directories containing image streams and templates. This significantly shortens the commands in the following sections. To do this:

    Creating Image Streams for OKD Images

    If your node hosts are subscribed using Red Hat Subscription Manager and you want to use the core set of image streams that used Red Hat Enterprise Linux (RHEL) 7 based images:

    1. $ oc create -f $IMAGESTREAMDIR/image-streams-rhel7.json -n openshift

    Alternatively, to create the core set of image streams that use the CentOS 7 based images:

    Creating both the CentOS and RHEL sets of image streams is not possible, because they use the same names. To have both sets of image streams available to users, either create one set in a different project, or edit one of the files and modify the image stream names to make them unique.

    The database service templates make it easy to run a database image which can be utilized by other components. For each database (, MySQL, and ), two templates are defined.

    The other template defines a persistent volume for storage, however it requires your OKD installation to have persistent volumes configured.

    To create the core set of database templates:

    After creating the templates, users are able to easily instantiate the various templates, giving them quick access to a database deployment.

    Creating Instant App and Quickstart Templates

    The Instant App and Quickstart templates define a full set of objects for a running application. These include:

    • Build configurations to build the application from source located in a GitHub public repository

    • to deploy the application image after it is built.

    • Services to provide load balancing for the application .

    Some of the templates also define a database deployment and service so the application can perform database operations.

    The templates which define a database use ephemeral storage for the database content. These templates should be used for demonstration purposes only as all database data will be lost if the database pod restarts for any reason.

    Using these templates, users are able to easily instantiate full applications using the various language images provided with OKD. They can also customize the template parameters during instantiation so that it builds source from their own repository rather than the sample repository, so this provides a simple starting point for building new applications.

    To create the core Instant App and Quickstart templates:

    With these artifacts created, developers can now log into the web console and follow the flow for . Any of the database or application templates can be selected to create a running database service or application in the current project. Note that some of the application templates define their own database services as well.

    The example applications are all built out of GitHub repositories which are referenced in the templates by default, as seen in the **SOURCE_REPOSITORY_URL** parameter value. Those repositories can be forked, and the fork can be provided as the parameter value when creating from the templates. This allows developers to experiment with creating their own applications.

    You can direct your developers to the Using the Instant App and Quickstart Templates section in the Developer Guide for these instructions.