|
| 1 | +## Using Red Hat Single Sign-On 7.5 container images with alternative JDK |
| 2 | + |
| 3 | +The Red Hat Single Sign-On 7.5 for OpenJDK container images use the [Red Hat OpenJDK 11](https://access.redhat.com/documentation/en-us/openjdk/11/html-single/getting_started_with_openjdk_11/index#openjdk-overview), a free and open source implementation of the Java Platform, Standard Edition (Java SE) by default. |
| 4 | + |
| 5 | +To provide an illustrative example on how to install an alternative JDK and instruct the Red Hat Single Sign-On 7.5 container images to use it, the 'ibm-semeru-open-11-jdk' subdirectory contains a definition of Red Hat Single Sign-On 7.5 container file switching the JDK runtime to the latest available release of [IBM Semeru Runtime Open Edition Java 11 (LTS)](https://github.com/ibmruntimes/semeru11-binaries/releases/latest). |
| 6 | + |
| 7 | +## Building the Red Hat Single Sign-On 7.5 container image with latest release of IBM Semeru 11 JDK Open Edition |
| 8 | + |
| 9 | +You can build this example by creating a new build using OpenShift CLI (oc) tool. Specify: |
| 10 | +* The vanilla `rh-sso-7/sso75-openshift-rhel8` image stream to use as the builder, |
| 11 | +* The Docker build strategy to use for build execution, and |
| 12 | +* The Git repository, branch name and particular context directory within the repository as the source of the build |
| 13 | + |
| 14 | +**Prerequisites** |
| 15 | + |
| 16 | +* Ensure you have [OpenShift CLI (oc) installed](https://docs.openshift.com/container-platform/latest/cli_reference/openshift_cli/getting-started-cli.html#installing-openshift-cli) |
| 17 | + |
| 18 | +**Procedure** |
| 19 | + |
| 20 | +1. Ensure that you are logged in as a cluster administrator or a user with project administrator access to the global `openshift` project. Choose the following command based on your version of OpenShift Container Platform: |
| 21 | + |
| 22 | + * If you are running an OpenShift Container Platform v3 based cluster instance on (some) of your master host(s), perform the following: |
| 23 | + |
| 24 | + ``` |
| 25 | + $ oc login -u system:admin |
| 26 | + ``` |
| 27 | +
|
| 28 | + * If you are running an OpenShift Container Platform v4 based cluster instance, [log in to the CLI](https://docs.openshift.com/container-platform/latest/cli_reference/openshift_cli/getting-started-cli.html#cli-logging-in_cli-developer-commands) as the [kubeadmin](https://docs.openshift.com/container-platform/latest/authentication/remove-kubeadmin.html#understanding-kubeadmin_removing-kubeadmin) user: |
| 29 | +
|
| 30 | + ``` |
| 31 | + $ oc login -u kubeadmin -p password https://openshift.example.com:6443 |
| 32 | + ``` |
| 33 | +
|
| 34 | +2. Execute the following command: |
| 35 | +
|
| 36 | + ``` |
| 37 | + $ oc new-build \ |
| 38 | + --context-dir=jdk/ibm-semeru-open-11-jdk \ |
| 39 | + --image-stream=sso75-openshift-rhel8 \ |
| 40 | + --name=sso75-openshift-rhel8-ibm-semeru-11-jdk \ |
| 41 | + --namespace=openshift \ |
| 42 | + --strategy=docker \ |
| 43 | + https://github.com/jboss-container-images/redhat-sso-7-openshift-image.git#sso75-dev |
| 44 | + ``` |
| 45 | +
|
| 46 | +When submitted, this command creates a new `sso75-openshift-rhel8-ibm-semeru-11-jdk` BuildConfig definition in the global `openshift` project and launches a build from it. Moreover, a new `sso75-openshift-rhel8-ibm-semeru-11-jdk` ImageStream is also created in the global `openshift` project. |
| 47 | +
|
| 48 | +## Acquiring OpenShift templates for the new Red Hat Single Sign-On 7.5 container `sso75-openshift-rhel8-ibm-semeru-11-jdk` image stream |
| 49 | +
|
| 50 | +You can obtain OpenShift templates for the newly produced `sso75-openshift-rhel8-ibm-semeru-11-jdk` image stream by performing the following modifications [to the standard templates available for the Red Hat Single Sign-On 7.5 container image](https://github.com/jboss-container-images/redhat-sso-7-openshift-image/tree/sso75-dev/templates): |
| 51 | +
|
| 52 | + * Change the default image stream name and image tag from `"sso75-openshift-rhel8:7.5"` to `"sso75-openshift-rhel8-ibm-semeru-11-jdk"`, |
| 53 | +
|
| 54 | + * Optinally add a custom suffix to the name of the original template later better to distinguish the newly created templates for IBM Semeru 11 JDK Open Edition from the original one. Alternatively, if **you just want to modify** [**the default Red Hat Single Sign-On 7.5 container image OpenShift templates**](https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.5/html-single/red_hat_single_sign-on_for_openshift#sso-templates) to start using the new `sso75-openshift-rhel8-ibm-semeru-11-jdk` image stream, then **define the custom suffix to be empty string**. |
| 55 | +
|
| 56 | +### Modifying the default Red Hat Single Sign-On 7.5 container image templates to use `"sso75-openshift-rhel8-ibm-semeru-11-jdk"` image stream |
| 57 | +
|
| 58 | +Use this option if you want to continue using the [**the default Red Hat Single Sign-On 7.5 container image OpenShift templates**](https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.5/html-single/red_hat_single_sign-on_for_openshift#sso-templates) with the new `sso75-openshift-rhel8-ibm-semeru-11-jdk` image stream. |
| 59 | +
|
| 60 | +**Prerequisites** |
| 61 | +
|
| 62 | +* Ensure you have [the default OpenShift templates for Red Hat Single Sign-On 7.5 container image installed](https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.5/html-single/red_hat_single_sign-on_for_openshift/index#image-streams-applications-templates). |
| 63 | +
|
| 64 | +**Procedure** |
| 65 | +
|
| 66 | +1. Set TEMPLATE\_SUFFIX environment variable to empty string and run the `acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh` helper script as follows: |
| 67 | +
|
| 68 | + ``` |
| 69 | + $ TEMPLATE_SUFFIX="" ./ibm-semeru-open-11-jdk/scripts/templates/acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh |
| 70 | + ``` |
| 71 | +
|
| 72 | + In this case the `./ibm-semeru-open-11-jdk/scripts/templates/acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh` script will just change the image stream name from `"sso75-openshift-rhel8:7.5"` to `"sso75-openshift-rhel8-ibm-semeru-11-jdk"` for each of the default Red Hat Single Sign-On 7.5 container image templates. |
| 73 | +
|
| 74 | + As a result, the output of the script looks as follows: |
| 75 | +
|
| 76 | + ``` |
| 77 | + $ TEMPLATE_SUFFIX="" ./ibm-semeru-open-11-jdk/scripts/templates/acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh |
| 78 | + template.template.openshift.io "sso75-https" deleted |
| 79 | + template.template.openshift.io/sso75-https replaced |
| 80 | + template.template.openshift.io "sso75-postgresql" deleted |
| 81 | + template.template.openshift.io/sso75-postgresql replaced |
| 82 | + template.template.openshift.io "sso75-postgresql-persistent" deleted |
| 83 | + template.template.openshift.io/sso75-postgresql-persistent replaced |
| 84 | + template.template.openshift.io "sso75-x509-https" deleted |
| 85 | + template.template.openshift.io/sso75-x509-https replaced |
| 86 | + template.template.openshift.io "sso75-x509-postgresql" deleted |
| 87 | + template.template.openshift.io/sso75-x509-postgresql-persistent replaced |
| 88 | + ``` |
| 89 | +
|
| 90 | +### Generating IBM Semeru 11 JDK Open Edition specific Red Hat Single Sign-On 7.5 container image templates |
| 91 | +
|
| 92 | +Use this option if you want a new template with custom suffix in its name to be created for each of the default RH-SSO templates using the `sso75-openshift-rhel8-ibm-semeru-11-jdk` image stream. |
| 93 | +
|
| 94 | +**Prerequisites** |
| 95 | +
|
| 96 | +* Ensure you have [the default OpenShift templates for Red Hat Single Sign-On 7.5 container image installed](https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.5/html-single/red_hat_single_sign-on_for_openshift/index#image-streams-applications-templates). |
| 97 | +
|
| 98 | +
|
| 99 | +**Procedure** |
| 100 | +
|
| 101 | +1. Set TEMPLATE\_SUFFIX environment variable to contain the desired suffix for newly generated templates, for example `"-ibm-semeru-11-jdk"`. Then run the `acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh` helper script as follows: |
| 102 | +
|
| 103 | +
|
| 104 | + ``` |
| 105 | + $ TEMPLATE_SUFFIX="-ibm-semeru-11-jdk" ./ibm-semeru-open-11-jdk/scripts/templates/acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh |
| 106 | + ``` |
| 107 | +
|
| 108 | + In this case the `./ibm-semeru-open-11-jdk/scripts/templates/acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh` script: |
| 109 | +
|
| 110 | + 1. First creates a Semeru JDK 11 counterpart copy of the particular default template with specified template suffix appended to the file name of the original template, |
| 111 | + 2. Updates the `.metadata.name` field of that template copy to match the new name of the template, |
| 112 | + 3. Replaces the name of the default image stream in the `sso` DeploymentConfig definition of the template with `sso75-openshift-rhel8-ibm-semeru-11-jdk` image stream, |
| 113 | + 4. Finally, recreates the template with the new name using the updated image stream in the global `openshift` project. |
| 114 | +
|
| 115 | + As a result, the output of the script looks as follows: |
| 116 | +
|
| 117 | + ``` |
| 118 | + $ TEMPLATE_SUFFIX="-ibm-semeru-11-jdk" ./ibm-semeru-open-11-jdk/scripts/templates/acquire-ibm-semeru-open-11-jdk-rh-sso-templates.sh |
| 119 | + template.template.openshift.io "sso75-https-ibm-semeru-11-jdk" deleted |
| 120 | + template.template.openshift.io/sso75-https-ibm-semeru-11-jdk replaced |
| 121 | + template.template.openshift.io "sso75-postgresql-ibm-semeru-11-jdk" deleted |
| 122 | + template.template.openshift.io/sso75-postgresql-ibm-semeru-11-jdk replaced |
| 123 | + template.template.openshift.io "sso75-postgresql-persistent-ibm-semeru-11-jdk" deleted |
| 124 | + template.template.openshift.io/sso75-postgresql-persistent-ibm-semeru-11-jdk replaced |
| 125 | + template.template.openshift.io "sso75-x509-https-ibm-semeru-11-jdk" deleted |
| 126 | + template.template.openshift.io/sso75-x509-https-ibm-semeru-11-jdk replaced |
| 127 | + template.template.openshift.io "sso75-x509-postgresql-persistent-ibm-semeru-11-jdk" deleted |
| 128 | + template.template.openshift.io/sso75-x509-postgresql-persistent-ibm-semeru-11-jdk replaced |
| 129 | + ``` |
| 130 | +
|
| 131 | +## Deploying Red Hat Single Sign-On 7.5 container image with latest release of IBM Semeru 11 JDK Open Edition |
| 132 | +
|
| 133 | +You can deploy Red Hat Single Sign-On 7.5 container image using latest IBM Semeru 11 JDK Open Edition as usual. The only differing step is the name of the template to use depending if default templates were overwritten, or new ones were generated. |
| 134 | +
|
| 135 | +**Procedure** |
| 136 | +
|
| 137 | +1. Create a `semeru-demo` project: |
| 138 | +
|
| 139 | + ``` |
| 140 | + $ oc new-project semeru-demo |
| 141 | + ``` |
| 142 | +
|
| 143 | +2. Create a new application, using the Red Hat Single Sign-On 7.5 container image with latest release of IBM Semeru 11 JDK Open Edition as usual. For example, run: |
| 144 | +
|
| 145 | + ``` |
| 146 | + $ oc new-app --template=sso75-x509-https |
| 147 | + ``` |
| 148 | +
|
| 149 | + if you previously modified the default `sso75-x509-https` template to start using the `sso75-openshift-rhel8-ibm-semeru-11-jdk`, or run |
| 150 | +
|
| 151 | + ``` |
| 152 | + $ oc new-app --template=sso75-x509-https-ibm-semeru-11-jdk |
| 153 | + ``` |
| 154 | +
|
| 155 | + if you previously generated IBM Semeru 11 JDK Open Edition templates using the `-ibm-semeru-11-jdk` suffix and want to deploy the IBM Semeru counterpart of `sso75-x509-https` template. |
| 156 | +
|
| 157 | +## References |
| 158 | +
|
| 159 | +* [IBM Semeru Runtimes Open Edition for Java 11 binaries GitHub repository](https://github.com/ibmruntimes/semeru11-binaries) |
| 160 | +* [IBM Semeru Runtimes main GitHub repository](https://github.com/ibmruntimes/Semeru-Runtimes) |
| 161 | +* [IBM Semeru Runtimes website](https://developer.ibm.com/languages/java/semeru-runtimes) |
| 162 | +* [IBM Semeru Runtimes support page](https://www.ibm.com/support/pages/semeru-runtimes-support/) |
0 commit comments