Modernizing Oracle WebLogic Applications
With the onset of Container technology, organizations have been very interested and keen to adopt these technologies.
In this post, I would like to give my view on how one can modernize their existing applications deployed on Oracle WebLogic Server, to adopt containerization technologies.
As what I think, there are a couple of options available to achieve this.
1. Build your Container Images (say using Dockers) and run them as individual containers and manually manage the same.
2. Build your Container Images (say using Dockers) and manage the same using Container Management technologies like Kubernetes.
3. Build your Container Images (say using Dockers) and manage the same using Kubernetes, by using the Operator and Custom Resource constructs of Kubernetes.
This article focuses on the Option 3.
Why WebLogic Operator?
A question that comes to our mind when talking on this topic is “What is the use of a WebLogic Operator? When we already have technologies like Dockers — to create containers and Kubernetes to manage container environment”
To answer this question, we need to understand what “Operator” is in Kubernetes environment.
Putting it in simple terms, Operators are used to manage Stateful Applications within Kubernetes.
Kubernetes can easily manage Stateless Applications using the Control Loop mechanism. As with Stateless Applications, Kubernetes does not need to worry about what a container was/is doing and can easily replace the running pod(s).
However, to manage Stateful Application, Kubernetes needs to have good level of understanding in-terms of how these applications work and maintain its state. Depending on the application/technology, there might be certain steps to be followed before a pod is destroyed OR new pod added to existing cluster. To achieve this sometimes we might need human intervention OR would need a human “Operator” to manage this environment. However, by doing so, we are negating the entire premise of using Kubernetes and getting the benefit of ‘Automation’ and ‘Self-Healing’.
Hence, to achieve these fundamental tasks that the human operator performs, one can develop Application/Technology specific Operator, which has the knowledge of how to maintain that Application/Technology in a Kubernetes environment. Hence, the birth of “WebLogic Kubernetes Operator”.
What is WebLogic Kubernetes Operator?
Oracle WebLogic Server is certified on Dockers and Kubernetes.
WebLogic Operator is a Container Image (available here) and at runtime it runs as a process within a container deployed into a Kubernetes Pod.
The operator registers a Kubernetes custom resource definition called domain.weblogic.oracle (shortname domain, plural domains).
Using the operator one can perform the below key tasks:
1. Manage WebLogic domains within Kubernetes Namespaces in a Kubernetes Cluster.
2. Configure deployment of WebLogic domains as a Kubernetes resource (using a Kubernetes custom resource definition).
3. Override certain aspects of the WebLogic domain configuration; for example, use a different database password for different deployments.
4. Start and stop servers and clusters in the domain based on declarative startup parameters and desired states.
5. Scale WebLogic domains by starting and stopping Managed Servers on demand, or by integrating with a REST API to initiate scaling based on the WebLogic Diagnostics Framework (WLDF), Prometheus, Grafana, or other rules.
6. And many others
Below is the link to get detailed information on this topic:
https://oracle.github.io/weblogic-kubernetes-operator/
https://github.com/oracle/weblogic-kubernetes-operator
There are a few key points that will help you understand and decide your application deployment on Kubernetes:
1. Design Philosophy
a. https://oracle.github.io/weblogic-kubernetes-operator/userguide/introduction/design/
2. Architecture
a. https://oracle.github.io/weblogic-kubernetes-operator/userguide/introduction/architecture/
3. Choose a domain home source type
a. https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/choosing-a-model/
Supporting Tools
To assist with adopting container technologies, Oracle has developed few open source tools that ease different aspects of developing, deploying and maintaining applications in container environments.
1. WebLogic Server Deploy Tooling
It is always challenging to create and maintain custom WLST scripts to automate the process domain creation and application deployment. To overcome this challenge, Oracle has come up with WebLogic Server Deploy Tooling (WDT) project, to assist with these processes. This project consists of several single-purpose tools, which assist you with different aspects of managing the WebLogic domain like, Creating Domain, Updating Domain, Deploying Applications, etc. Using these tools one does not have to write and maintain WLST scripts, but define a declarative metadata model describing the domain and applications.
For detailed information on this WDT project, please refer the link below:
https://github.com/oracle/weblogic-deploy-tooling
2. WebLogic Image Tool
To assist with creating of Docker Images for WebLogic Server, Oracle offers an open source Oracle WebLogic Image Tool. This tool lets you create a new Linux based image, with installations of a JDK and WebLogic Server, and optionally, configure a WebLogic domain with your applications, apply WebLogic Server patches, or update an existing image.
For detailed information on this tool, please refer the link below:
https://github.com/oracle/weblogic-image-tool
3. WebLogic Monitoring Exporter
WebLogic Monitoring Exporter exposes metrics and monitoring data through WebLogic RESTful Management APIs for consumption by other tools (e.g. Prometheus). This exporter is available in 2 forms;
1. As a Web Application, which you deploy on the server which you would like to monitor.
2. As a separate process that is run alongside a server instance.
For a detailed information on this topic, please refer the link below:
https://github.com/oracle/weblogic-monitoring-exporter
4. WebLogic Logging Exporter
One can use WebLogic Logging Exporter to access WebLogic logs information through Elasticsearch and Kibana. It adds a log event handler to WebLogic Server, such that WebLogic Server logs can be integrated into Elastic Stack in Kubernetes directly, by using the Elasticsearch REST API.
For detailed information on this topic, please refer the link below:
https://github.com/oracle/weblogic-logging-exporter
References
https://oracle.github.io/weblogic-kubernetes-operator/
https://github.com/oracle/weblogic-kubernetes-operator
https://github.com/oracle/weblogic-deploy-tooling
https://github.com/oracle/weblogic-image-tool
https://github.com/oracle/weblogic-monitoring-exporter
https://github.com/oracle/weblogic-logging-exporter
Disclaimer: All views expressed in this article are in my personal capacity and do not necessarily reflect any view from my employer or any other organization.