Run Oracle WebLogic on Azure Kubernetes Service
In September 2019 Oracle announced it’s partnership with Microsoft. Al lot of the Oracle solutions, such as databases, middleware, EBS and so on will become available on the Azure Marketplace somewhere in the near future.
Besides this tight integration, I also I wondered how many differences there are between the various managed Kubernetes services provided by different vendors. Now Oracle provides OKE(Oracle Kubernetes Engine) and Microsoft AKS(Azure Kubernetes Service). Following the multi cloud vendor strategy, I decided to setup an Oracle WebLogic Domain on an AKS.
So not the image and a VM which is also provided as a service, but the real container/orchestration stuff.. :)
Azure Subscription
My Azure description to be used is not a production one and just a personal one to do this research. My final aim is to get a WebLogic SOA Cluster running on Azure Kubernetes Service(AKS) and maybe deploy some application to it.
The subscription I worked with is a pay-as-you-go one. Now I won’t go through every detail setting up resources and so, because a lot of it speaks for itself. As said, I want to set up WebLogic SOA on AKS. For this I need to have or create:
- A resource group
- An AKS Cluster
- SSH access to the AKS nodes
- A private container registry
- Integration with Github and public container registries(docker, oracle)
- Container images for databases, WebLogic, SOA
- The WebLogic Kubernetes Operator, latest version
Maybe I don’t list all of it but that will come maybe later in this article
Setup AKS
Now, Azure has it’s own managed Kubernetes Service, just as Oracle does(OKE). The components around Kubernetes are pretty much the same; only the vendor specific tooling around it is vendor specific. A great benefit within Azure is the cloud shell, so you don’t need to use you local ssh client and can run this in you Azure portal directly.
Setting up AKS is, when you are accepting defaults and take the minimum is rather easy, so I decided to set it up via the console. If you want to do it more in an automated way you can always use Terraform.
First of all I needed to setup a storage account using the Azure CLI (az)
Then created my Kubernetes Cluster
After creation, these resources we’re created:
Be aware that the AKS Nodes don’t show up as individual Virtual Images but as resources in the Virtual Machine Scale Set. So with this the basic K8S was created.
Container Registry
This task was quite easy to using the Azure CLI:
Where $MYACR is the variable to the name of the registry.
Next, attach it to the AKS Cluster:
For managing WebLogic on Kubernetes, Oracle developed an open source Operator, the WebLogic Kubernetes Operator, which will do specific WebLogic tasks Kubernetes cannot perform.
I imported the latest image from docker and by importing it into the registry:
Showing in the console:
To obtain the scripts for creating a WebLogic SOA domain I cloned the github repository into my Azure Cloud Shell and install the operator using Helm.
To add the Helm repo: and listing:
So from out of the cloned github directory I could install the operator after creating a namespace and credentials in k8s:
and install it with helm:
NFS on nodes
To share persistent volumes across nodes I’ve setup NFS on all K8S nodes. However I needed direct access to the nodes which I did as follow:
- Generate a SSH keypair in the Azure Cloud Shell
Next I install a SSH K8S plugin to access the nodes via a pod
Now run the pod and copy the pubkey to it
And access the pod
From there I could ssh to all nodes to install and set up NFS on the master and worker nodes.
WebLogic / SOA on AKS
Well, from here it’s more or less the same as described in the Oracle Github documentation, no specific Azure bits to do. What I did was:
- Used the Github repository
Created a SOA Repository using the yaml file : ~/weblogic-kubernetes-operator/kubernetes/samples/scripts/create-soa-domain/domain-home-on-pv/create-database
- Created the RCU repository for SOA and run it
Note: for pulling the images I had to create secrets to be able to pull them
Now the rest of the setup, as said does not differ from setting it up on OKE, you can read that on the official Oracle Github Wiki.
Note: Another handy feature: To access the K8S dashboard, you can execute the following command and click on the generated link:
But you Azure geeks know that of course :).
Conclusion
As said, besides different tools WebLogic running on Azure Kubernetes Service does not differ a lot from running it on Oracle’s one. I’m not fully sure if Oracle supports it but I would expect they do to meet their multicloud strategy as they claim. Hope this helps you decide in your journey to the Cloud!