Este contenido no está disponible en el idioma seleccionado.

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.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat