Upgrade JBoss EAP Version

Since you started this guide you’ve been deploying Kitchensink on JBoss EAP 7.2, in different ways and namespaces, always using S2I to build the image starting from the source code of the Jakarta EE application.

One of the reasons we think S2I is awesome is that this framework should help you whenever you upgrade JBoss itself. The idea is that because you’re using S2I extensions mechanism which rely on JBoss scripts of S2I helper scripts, you don’t care about the underneath standalone.xml file…​ almost. In this lab you will upgrade JBoss from 7.2 to 7.4, let’s deal with this almost.

What’s Different

The most prominent thing you will have to deal with is the version of the builder image itself which changes from 7.2 to 7.4! But not only that, in fact there are a number of things different in 7.4 with regards to 7.2 but in this lab we only need to care about one; the PostgreSQL driver definition which is missing in 7.4.

You should always consult the release notes for a deeper understanding of changes between versions.

This means that you have to make a change in your extension/install.sh script in order to install the needed driver. You will do this later, but before you do.

Let’s start upgrading the builder image from 7.2 to 7.4 BUT only helm-kustomize-dev and helm-kustomize-test for simplicity. Fixing the other deployments could be a nice job to be done once you finish this lab.

You will have to make these changes in the corresponding git repos. To do so, please use these credentials:

  • Username: %USERNAME%

  • Password: openshift

Upgrade Builder Image Version

There is one location where we have to upgrade the builder image:

⇒ kitchensink-conf/cicd/values.yaml

The following link will take you to file kitchensink-conf/cicd/values.yaml where you have to do the following change.

https://repository-gitea-system.apps.%BASE_SUBDOMAIN%/%USERNAME%/kitchensink-conf/_edit/main/cicd/values.yaml#L21

Once there, you have to change this:

kitchensinkBuilderImage: jboss-eap72-openshift:1.2

With this

kitchensinkBuilderImage: jboss-eap74-openjdk8-openshift:7.4.0

Once you have made the changes scroll down and click on Commit Changes.

Refresh Applications in ArgoCD

Now let’s force the refresh of all our applications at once before we make the last change which will trigger the CI pipeline. To do that you have to go to Argo CD and click on REFRESH APPS then click on ALL as in the next picture.

Apps

Use this link to open Argo CD and see all applications then proceed as explained.

The following link has a query parameter search which will show only the applications of %USERNAME%.
https://openshift-gitops-server-openshift-gitops.apps.%BASE_SUBDOMAIN%/applications?search=%USERNAME%

Update install.sh

Please copy and paste the following link and open it in a browser. It will take you to file kitchensink/extensions/install.sh where you have to uncomment the line where the script configures the PostgreSQL driver.

https://repository-gitea-system.apps.%BASE_SUBDOMAIN%/%USERNAME%/kitchensink/_edit/main/extensions/install.sh#L12

Once there, you have to change this:

# configure_drivers ${injected_dir}/driver-postgresql.env

With this (or just uncomment the line):

configure_drivers ${injected_dir}/driver-postgresql.env

Once you have made the changes scroll down and click on Commit Changes.

What Did Just Happen?

Remember, you have committed and push a change in the CODE of kitchensink, because install.sh is CODE only that is code to adapt the image to your needs, but CODE!

As with all changes to code there is a webhook that will trigger the CI pipeline and also remember that the last action in that pipeline generates a Pull Request, it doesn’t deploy the new image yet!

CI PL Run

You can follow the progress through the following link and clicking on the Pipeline Run:

CI PL Run Progress
https://console-openshift-console.apps.%BASE_SUBDOMAIN%/dev-pipelines/ns/cicd-tekton-%USERNAME%

Final Tests

You have made changes in install.sh which should have trigger the CI pipeline you tested before.

Let’s check the version of JBoss before approving the Pull Request in kitchensink-conf.

oc logs deployment/kitchensink -n helm-kustomize-dev-%USERNAME% | grep -e "JBoss EAP 7"

You should expect something like:

17:51:03,635 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: JBoss EAP 7.2.9.GA (WildFly Core 6.0.30.Final-redhat-00001) starting
17:51:09,121 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.2.9.GA (WildFly Core 6.0.30.Final-redhat-00001) started in 5894ms - Started 65 of 86 services (30 services are lazy, passive or on-demand)
17:51:09,667 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0050: JBoss EAP 7.2.9.GA (WildFly Core 6.0.30.Final-redhat-00001) stopped in 37ms
17:51:11,987 INFO  [org.jboss.as] (MSC service thread 1-1) WFLYSRV0049: JBoss EAP 7.2.9.GA (WildFly Core 6.0.30.Final-redhat-00001) starting
17:51:48,114 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.2.9.GA (WildFly Core 6.0.30.Final-redhat-00001) started in 37487ms - Started 581 of 824 services (481 services are lazy, passive or on-demand)

Now you have to do the same, you know, go to kitchensink-conf, look for new Pull Requests, approve it and wait until the new image has been deployed in dev.

https://repository-gitea-system.apps.%BASE_SUBDOMAIN%/%USERNAME%/kitchensink-conf/pulls

Click on the Create merge commit button:

Gitea Approve PR

Before clicking the Create button, check the box to delete the branch after merging:

Gitea Approve PR

Once the new image has been rolled out, you could open the link to the UI, as you have done before…​ and then check in the logs if the new version is 7.4.*. You can do it with the next command.

oc logs deployment/kitchensink -n helm-kustomize-dev-%USERNAME% | grep -e "JBoss EAP 7"

You should expect something like:

8:13:17,374 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) starting
18:13:19,474 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) started in 3238ms - Started 75 of 99 services (38 services are lazy, passive or on-demand)
18:13:22,327 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) starting
18:13:24,585 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) started in 2480ms - Started 59 of 90 services (38 services are lazy, passive or on-demand)
18:13:24,930 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) stopped in 25ms
18:13:27,534 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) stopped in 36ms
18:13:27,535 INFO  [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) starting
18:13:38,480 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) started in 10944ms - Started 595 of 869 services (525 services are lazy, passive or on-demand)

At this point you can check that the status of the Pipelines is as follows (or wait until you reach that state before continuing):

CI/CD Pipelines Status

The last task of the CD Pipeline generated a new PR in the kitchensink-conf.

CD Pipeline Tasks

Then do the same with the new Pull Request and wait until the new image has been deployed in test.

POD_NAME=$(oc get pod -n helm-kustomize-test-%USERNAME% --field-selector=status.phase==Running -o jsonpath='{.items[0].metadata.name}')
oc logs ${POD_NAME} -n helm-kustomize-test-%USERNAME% | grep -e "JBoss EAP 7"

Recap

Good job! You started manually deploying a JBoss EAP application using S2I and ended up deploying it in multiple environments using GitOps to finally upgrade JBoss EAP from 7.2 to 7.4. That was quite a trip!

We hope you have enjoyed it and remember you can access all the code and conf here: