In this exercise we will deploy a SpringBoot application using a custom source to image builder image.
Step 1:
Using the knowledge you gained from the earlier labs create a new project with name spring-UserName.
Remember to substitute the UserName with your userid.
Step 2: Create a new application using SpringBoot S2I Builder image. Here we will deploy sample code from a git repository https://github.com/RedHatWorkshops/spring-sample-app. Please take time to understand the code; it is pretty simple.
You may want to clone this into your git repository and deploy that, if you want to make changes and test.
Note: We are using an S2I builder image from access.redhat.com/containers. This S2I builder image is https://access.redhat.com/containers/?tab=images&platform=openshift#/registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift
- login Web UI via browswer to https://:8443
- create a project with you username
- click Add to project
- search for "redhat-openjdk18-openshift"
- Click select from the redhat-openjdk18-openshift Version
- Name: bootapp
- Git Regposity URL: https://github.com/RedHatWorkshops/spring-sample-app.git
- Click Show advanced link
- Go to 'Build Configuration' section, add following Environment Variable: MAVEN_MIRROR_URL http://nexus.nexus.svc.cluster.local:8081/repository/maven-public
- Go to the end and click create.
- Click Builds/builds from left navigation
- Click bootapp
- Click View Log to view the build log
- Click on 'Overview' from the left navigation
- Click create route and Click create. Route will be created
- Test your spring boot application
Step 3
Test your application by using the hostname assigned in the route.
Congratulations!! You are now running a SpringBoot application on OpenShift.