This document describes when to restart servers in the Oracle WebLogic Server in Kubernetes environment.
There are many situations where changes to the Oracle WebLogic Server in Kubernetes environment require that all the servers in a domain or cluster be restarted, for example, when applying a WebLogic Server patch or when upgrading an application.
One of the operator’s most important jobs is to start and stop WebLogic Servers by creating and deleting their corresponding Kubernetes pods. Sometimes, you need to make changes that make the pods obsolete, therefore the pods need to be deleted and recreated. Depending on the change, sometimes the pods can be gradually recreated, without taking the entire domain out of service
(for example, rolling restarts
) and sometimes all the pods need to be deleted then recreated, taking the entire domain out of
service for a while (for example, full restarts
).
The following types of server restarts are supported in Oracle WebLogic Server in Kubernetes:
Rolling restarts - a coordinated and controlled shut down of all of the servers in a domain or cluster while ensuring that service to the end user is not interrupted.
Operator initiated - where the WebLogic Kubernetes Operator can detect some types of changes and will automatically initiate rolling restarts of server pods in a WebLogic domain.
Manually initiated - required when certain changes in the Oracle WebLogic Server in Kubernetes environment cannot be detected by the operator, so a rolling restart must be manually initiated.
Full domain restarts - the Administration Server and all the Managed Servers in a domain are shutdown, impacting service availability to the end user, and then restarted. Unlike a rolling restart, the operator cannot detect and initiate a full domain restart; it must always be manually initiated.
For detailed information on how to restart servers in a Oracle WebLogic Server in Kubernetes environment, see Starting, stopping, and restarting servers.
This document describes what actions you need to take to properly restart your servers for a number of common scenarios:
image
, volumes
, and env
)Changes to the Oracle WebLogic Server configuration may require either a rolling or full domain restart depending on the domain home location and the type of configuration change.
Domain home in image: For domain home in image, any changes (dynamic or non-dynamic) to the WebLogic configuration requires a full domain restart.
Domain home on PV: For domain home on PV, the type of restart needed to apply the changes, depends on the nature of the WebLogic configuration change:
stuck thread timer interval
property. See Restart all the servers in the domain in Starting, stopping, and restarting servers.Any change to domain configuration overrides requires a full domain restart. This includes:
configOverides
to point to a different configuration mapconfigOverridesSecrets
to point to a different list of secretsconfigOverrides
configOverridesSecrets
A change to the WebLogic Server credentials (the user name and password), contained in the Kubernetes secret for the domain, requires a
full domain restart. The Kubernetes secret can be updated directly or a new secret can be created and then referenced by the webLogicCredentialsSecret
property in the domain resource.
The operator will initiate a rolling restart of the domain when you modify any of the domain resource properties that affect the server pods configuration,
such as image
, volumes
, and env
. For a complete list, see Properties that cause servers to be restarted in Starting, stopping, and restarting servers.
You can modify these properties using the kubectl
command-line tool’s edit
and patch
commands or through the Kubernetes REST API.
For example, to edit the domain resource directly using the kubectl
command-line tool:
kubectl edit domain <domain name> -n <domain namespace>
The edit
command opens a text editor which lets you edit the domain resource in place.
Typically, it’s better to edit the domain resource directly; otherwise, if you scaled the domain, and you edit only the original domain.yaml
file and reapply it, you could go back to your old replicas count.
Oracle provides different types of patches for WebLogic Server, such as Patch Set Updates, Security Patch Updates, and One-Off patches. Information on whether a patch is rolling compatible or requires a manual full domain restart usually can be found in the patch’s documentation, such as the README file.
WebLogic Server patches can be applied to either a domain home in image or a domain home on PV.
With rolling compatible patches:
image
property with a new image name, then the operator will initiate a rolling restart.With patches that are not rolling compatible:
image
property with a new image name, then you must avoid the rolling restart by following the steps in Avoiding a rolling restart when changing image property on a domain resource.Frequent updates of deployed applications using a continuous integration/continuous delivery (CI/CD) process is a very common use case. The process for applying an updated application is different for domain home in image than it is for domain home on PV. A rolling compatible application update is where some servers are running the old version and some are running the new version of the application during the rolling restart process. On the other hand, an application update that is not rolling compatible requires that all the servers in the domain be shutdown and restarted.
If the application update is rolling compatible:
image
property with a new image name, then the operator will initiate a rolling restart.If the application update is not rolling compatible:
image
property with a new image name, then you must avoid the rolling restart by following the steps in Avoiding a rolling restart when changing image property on a domain resource.Follow these steps to create new rolling compatible image if you only need to patch your WebLogic Server domain or update application deployment files:
a. Select a different name for the new image.
b. Using the same domain home-in-image Docker image as a base, create a new Docker image by copying (COPY
command in a Dockerfile) the updated application deployment files or WebLogic Server patches into the Docker image during the Docker image build.
The key here is to make sure that you do not re-run WLST or WDT to create a new domain home even though it will have the same configuration. Creating a new domain will change the domain secret and you won’t be able to do a rolling restart.
c. Deploy the new Docker image to your Docker repository with the new name.
d. Update the image
property of the domain resource specifying the new image name.
For example:
```
domain:
spec:
image: oracle/weblogic-updated:2.5.0
```
e. The operator will now initiate a rolling restart, which will apply the updated image, for all the server pods in the domain.
image
property on a domain resourceIf you’ve created a new image that is not rolling compatible, and you’ve changed the image name, then:
Bring the domain down (stopping all the server pods) by setting the serverStartPolicy
to NEVER
. See Shut down all the servers in Starting, stopping, and restarting servers.
Update the image
property with a new image name.
Start up the domain (starting all the server pods) by setting the serverStartPolicy
to IF_NEEDED
.
Consider the order of changes:
If you need to make multiple changes to your domain at the same time, you’ll want to be careful about the order in which you do your changes, so that servers aren’t restarted prematurely or restarted needlessly. For example, if you want to change the readiness probe’s tuning parameters and the Java options (both of which are rolling compatible), then you should update the domain resource once, changing both values, so that the operator rolling restarts the servers once. Or, if you want to change the readiness probe’s tuning parameters (which is rolling compatible) and change the domain customizations (which require a full restart), then you should do a full shutdown first, then make the changes, and then restart the servers.
Alternatively, if you know that your set of changes are not rolling compatible, then you must avoiding a rolling restart by:
Bringing the domain down (stopping all the server pods) by setting the serverStartPolicy
to NEVER
. See Shut down all the servers in Starting, stopping, and restarting servers.
Make all your changes to the Oracle WebLogic Server in Kubernetes environment.
Starting up the domain (starting all the server pods) by setting the serverStartPolicy
to IF_NEEDED
.
Changes that require domain knowledge.
Sometimes you need to make changes that require server restarts, yet the changes are not to the WebLogic configuration, the image, or the Kubernetes resources that register your domain with the operator. For example, your servers are caching information from an external database and you’ve modified the contents of the database.
In these cases, you must manually initiate a restart.
Managed Coherence Servers safe shutdown.
If the domain is configured to use a Coherence cluster, then you will need to increase the Kubernetes graceful timeout value.
When a server is shut down, Coherence needs time to recover partitions and rebalance the cluster before it is safe to shut down a second server.
Using the Kubernetes graceful termination feature, the operator will automatically wait until the Coherence HAStatus MBean attribute
indicates that it is safe to shut down the server. However, after the graceful termination timeout expires, the pod will be deleted regardless.
Therefore, it is important to set the domain YAML timeoutSeconds
to a large enough value to prevent the server from shutting down before
Coherence is safe. Furthermore, if the operator is not able to access the Coherence MBean, then the server will not be shut down
until the domain timeoutSeconds
expires. To minimize any possibility of cache data loss, you should increase the timeoutSeconds
value to a large number, for example, 15 minutes.