How do I deploy jboss-eap-7/eap-74-openjdk8-openshift-rhel8 image on OpenShift?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- EAP 7 builder/runtime image: jboss-eap-7/eap-74-openjdk8-openshift-rhel8 (builder image)
- S2I EAP Template deployment
- OpenShift
- 4
Issue
- How do I deploy
jboss-eap-7/eap-74-openjdk8-openshift-rhel8image on OpenShift? - Importing with
eap74-openjdk8-rhel8-image-stream.jsonfails withNot Founderror.
oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates/eap74/eap74-openjdk8-rhel8-image-stream.json
oc get is jboss-eap74-openjdk8-rhel8-openshift -o yaml
...
message: 'Internal error occurred: registry.redhat.io/jboss-eap-7/eap74-openjdk8-openshift-rhel8:latest:
unknown: Not Found'
...
Resolution
The process below is extensively explained in the EAP 7.4 Guide Getting Started with JBoss EAP for OpenShift Container Platform -Chapter 2. Build and Run a Java Application on the JBoss EAP for OpenShift Image.
As explained above there are basically two approaches to deploy EAP in Openshift:
- Template deployment, which will build and deploy the application - template is the argument on the S2I
- JBoss EAP Operator deployment, which will deploy a certain specific image (that should be already in the Openshift cluster)
Below is explained the deployment via template. For customization for template, see the soluiton JBoss EAP S2I build template options.
Template deployment
Users can deploy EAP 7.4 image by following the steps:
1. Create a new project for helloworld application
oc new-project eap74-helloworld
2. Import template
oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-eap-openshift-templates/eap74/templates/eap74-basic-s2i.json
3. Import image from Red Hat Ecosystem Catalog
oc import-image jboss-eap74-openjdk8-rhel8-openshift:7.4.10 --from=registry.redhat.io/jboss-eap-7/eap-74-openjdk8-openshift-rhel8:7.4.10-4 --reference-policy=local --confirm
oc import-image jboss-eap74-openjdk8-rhel8-runtime-openshift:7.4.10 --from=registry.redhat.io/jboss-eap-7/eap-74-openjdk8-runtime-openshift-rhel8:7.4.10-4 --reference-policy=local --confirm
4. Deploy application pod with S2I build via EAP template:
oc new-app --template=eap74-basic-s2i \
-p APPLICATION_NAME=helloworld \
-p IMAGE_STREAM_NAMESPACE=eap74-helloworld \
-p EAP_IMAGE_NAME=jboss-eap74-openjdk8-rhel8-openshift:7.4.10 \
-p EAP_RUNTIME_IMAGE_NAME=jboss-eap74-openjdk8-rhel8-runtime-openshift:7.4.10 \
-p SOURCE_REPOSITORY_URL=https://github.com/jboss-developer/jboss-eap-quickstarts \
-p SOURCE_REPOSITORY_REF=7.4.x \
-p CONTEXT_DIR=helloworld-html5
How to update image version of JBoss EAP 7
If jboss-eap-7/eap-74-openjdk8-openshift-rhel8:7.4.10-5 and jboss-eap-7/eap-74-openjdk8-openshift-rhel8:7.4.10-5 will be relesed in the future, the image tag pointed to by ImageStreamTag can be switched with the following command. The triggers defined in BuildConfig and DeploymentConfig automatically initiate image rebuild and re-deployment when the following commands are run.
oc tag registry.redhat.io/jboss-eap-7/eap-74-openjdk8-openshift-rhel8:7.4.10-5 jboss-eap74-openjdk8-rhel8-openshift:7.4.10
oc tag registry.redhat.io/jboss-eap-7/eap-74-openjdk8-runtime-openshift-rhel8:7.4.10-5 jboss-eap74-openjdk8-rhel8-runtime-openshift:7.4.10
Root Cause
Follow the steps on EAP 7.4 Guide Getting Started with JBoss EAP for OpenShift Container Platform -Chapter 2. Build and Run a Java Application on the JBoss EAP for OpenShift Image for more specific and detailed information.
Diagnostic Steps
For troubleshooting steps see: Troubleshooting EAP 7 local BuildConfig in OCP 4.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.