Source to Image (S2I) compliant Apache HTTPD Server image which is an extension of the rhscl/httpd-24-rhel7
image provided by the Red Hat Software Collections Organization.
The OpenShift Container Platform (OCP) provides several out of the box Source to Image compliant images for many popular web technology frameworks, such as PHP, Python and NodeJS. There is also a need to provide a standalone web server, without the additional libraries and components included by these web frameworks.
This demo should be run on an installation of OpenShift Enterprise V3
A template called httpd-quickstart-rhel is available in the rhel-templates.json file
None
The upstream httpd-container from the Red Hat Software Collections organization contains a sample that is used the provided quick start template.
There is no specific requirements necessary for this demonstration. The presenter should have an OpenShift Enterprise 3 environment available with access to the public internet and the OpenShift Command Line Tools installed on their machine.
The following steps are to be used to demonstrate how to add a file containing the list of quickstarts to the OpenShift environment and to instantiate a template that will produce a build of the custom Apache HTTPD image and sample application.
Using the OpenShift CLI, login to the OpenShift environment.
oc login <OpenShift_Master_API_Address>
Create a new project called httpd-demo
oc new-project httpd-demo
A set of OpenShift templates have been provided to simplify usage of these container quickstarts in the quickstart-templates folder. To add a template to OpenShift, you can either clone the repository to your local machine or retrieve the template from GitHub.
If you have cloned the repository to your local machine, navigate to the quickstarts-templates folder and execute the following command to add the templates to the OpenShift project.
oc create -f rhel-templates.json
Otherwise, you can add the template directly from GitHub by executing the following command:
oc create -f https://raw.githubusercontent.com/redhat-cop/containers-quickstarts/master/quickstart-templates/rhel-templates.json
A template called httpd-quickstart-rhel has been provided in the previous set of created templates. The following actions are performed by the template:
- Perform a Docker build of a custom Apache HTTPD Source to Image compatible image
- Once the HTTPD image is built, it will trigger a new Source to Image build of a sample application
- A new container from the application image will be deployed
Execute the following command to instantiate the template:
oc new-app --template=httpd-quickstart-rhel
Track the statuses of the build by executing oc get builds
. When both builds are complete, validate the application has been deployed by listing the running pods:
oc get pods | grep Running
Verify the example application can be reached in a web browser. First, locate the url of the application by executing the following command
oc get routes
Using a web browser, navigate to the location referenced in the HOST/PORT column.
The application can be successfully validated if the webpage can be accessed