Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 14. Customizing OpenShift Enterprise


With the release of OpenShift Enterprise 2.1, the Management Console and default application settings are customizable to suit organizational branding.

14.1. Creating Custom Application Templates

When an application is created, the default application content and Git repository is created from a template supplied by the application's web cartridge. You can customize these templates without creating an entirely custom cartridge. For example, you can modify the initial content with organizational branding.

Note

Customizations only apply to newly created applications and do not apply to existing applications. You can also use the --from-code option when creating an application to specify a different application template.

Procedure 14.1. To Create an Application Template:

  1. Create an application using the desired cartridge, then change into the Git directory:
    $ rhc app create App_Name Cart_Namerhc app create App_Name Cart_Namerhc app create App_Name Cart_Namerhc app create App_Name Cart_Name
    $ cd App_Namecd App_Name
    Copy to Clipboard Toggle word wrap
  2. Make any desired changes to the default cartridge template. Templates can include more than application content, such as application server configuration files.
    If you are creating an application template from a JBoss EAP or JBoss EWS cartridge, you may want to modify settings such as groupId and artifactId in the pom.xml file, as these settings are equal to the App_Name value used above. It is possible to use environment variables, such as ${env.OPENSHIFT_APP_DNS}, however it is not recommended by Red Hat because Maven will issue warnings on each subsequent build, and the ability to use environment variables might be removed in future versions of Maven.
  3. Commit the changes to the local Git repository:
    $ git add .
    $ git commit -am "Template Customization"
    Copy to Clipboard Toggle word wrap
    You can now use this repository as an application template.
  4. Place the template into a shared space that is readable by each node host. This could be on Github, an internal Git server, or a directory on each node host. Red Hat recommends creating a local directory named templates, then cloning the template into the new directory:
    $ mkdir -p /etc/openshift/templates
    $ git clone --bare App_Name /etc/openshift/templates/Cart_Name.gitgit clone --bare App_Name /etc/openshift/templates/Cart_Name.gitgit clone --bare App_Name /etc/openshift/templates/Cart_Name.gitgit clone --bare App_Name /etc/openshift/templates/Cart_Name.gitgit clone --bare App_Name /etc/openshift/templates/Cart_Name.git
    Copy to Clipboard Toggle word wrap
  5. Next, edit the /etc/openshift/broker.conf file on the broker host, specifying the new template repository as the default location to pull from each time an application is created:
    DEFAULT_APP_TEMPLATES=Cart_Name|file:///etc/openshift/templates/Cart_Name.git
    Copy to Clipboard Toggle word wrap

    Note

    The broker provides the same cartridge template location to all nodes, so the template location must be available on all node hosts or application creation will fail.
  6. Restart the broker for the changes to take effect:
    $ service openshift-broker restart
    Copy to Clipboard Toggle word wrap
    Any applications created using the specified cartridge will now draw from the customized template.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat