Deploying Java Microservices to OpenShift on IBM Cloud
This workshop demonstrates how to build a microservice with Java and how to deploy it to OpenShift on the IBM Cloud.
The microservice is kept as simple as possible, so that it can be used as a starting point for other microservices. The microservice has been developed with Java EE and Eclipse MicroProfile.
There are various ways to deploy applications to OpenShift. The options have different advantages and disadvantages which are explained in the following labs.
This workshop has seven labs. It should take between 60 and 90 minutues to complete the workshop.
- Overview video (1:41 mins)
- Installing prerequisites: lab and video (2:58 mins)
- Running the Java microservice locally: lab and video (3:51 mins)
- Understanding the Java implementation: lab and video (9:09 mins)
- Deploying to OpenShift via 'oc' CLI: lab and video (14:32 mins)
- Deploying existing images to OpenShift: lab and video (7:09 mins)
- Deployments of code in GitHub repos: lab and video (3:52 mins)
- Source to Image deployments: lab and video (7:06 mins)
The first lab describes how to install all required prerequisites. In the easiest case this is only Docker Desktop and an image with all other tools.
Lab 2 and 3 describe how to develop a microservice with Java EE and Eclipse MicroProfile.
The last four labs explain four different ways to deploy applications to OpenShift with their pros and cons in this specific scenario:
|Option||Dockerfile||yaml Files||Java Build||Docker Build|
|Lab 4: Kubernetes-like||required||required||OpenShift||OpenShift|
|Lab 5: Existing Image||not required||not required||N/A||N/A|
|Lab 6: Git Repo||required||not required||OpenShift||OpenShift|
|Lab 7: Source to Image||not required||not required||Desktop||OpenShift|