Author: Daniyal Javed


In this blog I’ll describe how to run WebLogic on OpenShift. There is an official guide from Oracle on how to configure WebLogic on Kubernetes and there is a small tutorial on how to run WebLogic on OpenShift by Gerald Nunn from Red Hat. I will be combining the two to create a detailed step by step guide on how to achieve this. I have created a GitHub repo by extracting only the goodies we will need for this guide.

Clone the repo

$ git clone https://github.com/daniyalj/weblogic-openshift
$ cd weblogic-openshift

Download Oracle Server JRE

Download Server JRE here and place it in OracleJava/java-8/

Build Server JRE Docker image

$ docker build -t oracle/serverjre:8 OracleJava/java-8/

Download WebLogic Server Installers

Download Generic Installer for Oracle WebLogic Server and Quick Installer for Oracle WebLogic

Place the two downloaded files under OracleWebLogic/dockerfiles/12.2.1.3

Build WebLogic Docker images

$ docker build -t oracle/weblogic:12.2.1.3-developer OracleWebLogic/dockerfiles/12.2.1.3/
$ docker build --build-arg ADMIN_PASS=Welcome1 --build-arg ADMIN_USER=weblogic -t wls-12213-domain OracleWebLogic/samples/wls-K8s/wls-12213-domain/
$ docker build -t wls-12213-oow-demo-domain -f OracleWebLogic/samples/wls-K8s/wls-12213-domain/Dockerfile.adddemoapps OracleWebLogic/samples/wls-K8s/wls-12213-domain/
$ docker build -t oow-demo-webhook -f OracleWebLogic/samples/wls-K8s/wls-12213-domain/Dockerfile.webhook OracleWebLogic/samples/wls-K8s/wls-12213-domain/

Push images to OpenShift Registry

  • Login to OpenShift Registry
$ docker login -u ocpadmin -p $(oc whoami -t) docker-registry-default.apps.ocp.arctiq.ca
  • Tag images for OpenShift
$ docker tag wls-12213-oow-demo-domain docker-registry-default.apps.ocp.arctiq.ca/weblogic/wls-12213-oow-demo-domain:latest
$ docker tag oow-demo-webhook docker-registry-default.apps.ocp.arctiq.ca/weblogic/oow-demo-webhook:latest
  • Create a project in OpenShift for WebLogic
$ oc new-project weblogic
  • Push images to OpenShift
$ docker push docker-registry-default.apps.ocp.arctiq.ca/weblogic/wls-12213-oow-demo-domain:latest
$ docker push docker-registry-default.apps.ocp.arctiq.ca/weblogic/oow-demo-webhook:latest

Create stateful set for WebLogic on OpenShift

$ oc create -f OracleWebLogic/samples/wls-K8s/k8s/wls-admin-webhook.yml
$ oc create -f OracleWebLogic/samples/wls-K8s/k8s/wls-stateful.yml
  • Make sure the containers are ready and running by navigating to Applications → Pods:
  • Expose the route for weblogic
$ oc expose svc/wls-admin-server

Open WebLogic in a browser and REJOICE!!

I won’t get into if running WebLogic on OpenShift is the right approach or not but this guide shows off the power of OpenShift and Kubernetes very nicely. An app that takes quite a lot of time to install and configure on a traditional system takes only minutes with OpenShift. If you are interested in learning more about OpenShift feel free to reach out using the chat dialog below.

Tagged:



//comments