Skip to content

Commit 6860be2

Browse files
committed
Merge branch 'main' into remove_sh_function
2 parents de86d95 + c2d01d9 commit 6860be2

File tree

12 files changed

+169
-52
lines changed

12 files changed

+169
-52
lines changed

documentation/staging/content/faq/resource-settings.md

+56-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: "Tune container memory and CPU usage by configuring Kubernetes reso
99
#### Contents
1010

1111
- [Introduction](#introduction)
12-
- [Setting resource requests and limits in a Domain YAML file](#setting-resource-requests-and-limits-in-a-domain)
12+
- [Setting resource requests and limits in a Domain resource](#setting-resource-requests-and-limits-in-a-domain-resource)
1313
- [Determining Pod Quality Of Service](#determining-pod-quality-of-service)
1414
- [Java heap size and memory resource considerations](#java-heap-size-and-memory-resource-considerations)
1515
- [Importance of setting heap size and memory resources](#importance-of-setting-heap-size-and-memory-resources)
@@ -23,13 +23,63 @@ description: "Tune container memory and CPU usage by configuring Kubernetes reso
2323

2424
#### Introduction
2525

26-
The operator creates a container in its own Pod for each WebLogic Server instance. You can tune container memory and CPU usage by configuring Kubernetes resource requests and limits, and you can tune a WebLogic JVM heap usage using the `USER_MEM_ARGS` environment variable in your Domain YAML file. A resource request sets the minimum amount of a resource that a container requires. A resource limit is the maximum amount of a resource a container is given and prevents a container from using more than its share of a resource. Additionally, resource requests and limits determine a Pod's quality of service.
26+
The CPU and memory requests and limits for WebLogic Server Pods usually need to be tuned
27+
where the optimal values depend on your workload, applications, and the Kubernetes environment.
28+
Requests and limits should be configured based on the expected traffic during peak usage.
29+
For example:
30+
31+
- Tune CPU and memory high enough
32+
to handle expected peak workloads for applications
33+
that require large amounts of in-memory processing
34+
or very CPU intensive calculations.
35+
- Tune memory high enough so that WebLogic JMS messaging
36+
applications that generate large backlogs of unprocessed
37+
persistent or non-persistent messages
38+
can expect JMS to efficiently cache the backlogs in memory.
39+
- CPU requirements are sometimes significantly higher
40+
when a WebLogic Server is starting. This means that a low CPU
41+
allocation that might be suitable for
42+
light runtime workloads risks causing unacceptably slow startup times.
43+
44+
Requirements vary considerably between use cases.
45+
You may need to experiment and make adjustments
46+
based on monitoring resource usage in your environment.
47+
48+
The operator creates a container in its own Pod for each domain's
49+
WebLogic Server instances and for the short-lived introspector job that
50+
is automatically launched before WebLogic Server Pods are launched.
51+
You can tune container memory and CPU usage
52+
by configuring Kubernetes resource requests and limits,
53+
and you can tune a WebLogic JVM heap usage
54+
using the `USER_MEM_ARGS` environment variable in your Domain YAML file.
55+
The introspector job pod uses the same CPU and memory settings as the
56+
domain's WebLogic Administration Server pod.
57+
A resource request sets the minimum amount of a resource that a container requires.
58+
A resource limit is the maximum amount of a resource a container is given
59+
and prevents a container from using more than its share of a resource.
60+
Additionally, resource requests and limits determine a Pod's quality of service.
2761

2862
This FAQ discusses tuning these parameters so WebLogic Server instances run efficiently.
2963

30-
#### Setting resource requests and limits in a Domain
31-
32-
You can set Kubernetes memory and CPU requests and limits in a [Domain YAML file]({{< relref "/userguide/managing-domains/domain-resource" >}}) using its `spec.serverPod.resources` stanza, and you can override the setting for individual WebLogic Server instances or clusters using the `serverPod.resources` element in `spec.adminServer`, `spec.clusters`, or `spec.managedServers`. For example:
64+
#### Setting resource requests and limits in a Domain resource
65+
66+
You can set Kubernetes memory and CPU requests and limits in a
67+
[Domain YAML file]({{< relref "/userguide/managing-domains/domain-resource" >}})
68+
using its `spec.serverPod.resources` stanza,
69+
and you can override the setting for individual WebLogic Server instances or clusters using the
70+
`serverPod.resources` element in `spec.adminServer`, `spec.clusters`, or `spec.managedServers`.
71+
Note that the introspector job pod uses the same settings
72+
as the WebLogic Administration Server pod.
73+
74+
Values set in the `.serverPod` stanzas for a more specific type of pod, override
75+
the same values if they are also set for a more general type of pod, and inherit
76+
any other values set in the more general pod.
77+
The `spec.adminServer.serverPod`, `spec.managedServers.serverPod`,
78+
and `spec.clusters.serverPod` stanzas all inherit from and override
79+
the `spec.serverPod` stanza. When a `spec.managedServers.serverPod` stanza
80+
refers to a pod that is part of a cluster, it inherits
81+
from and overrides from its cluster's `spec.clusters.serverPod` setting (if any),
82+
which in turn inherits from and overrides the domain's `spec.serverPod` setting.
3383

3484
```yaml
3585
spec:
@@ -156,7 +206,7 @@ Similarly, the operator samples configure CPU and memory resource requests to at
156206

157207
There's no memory or CPU limit configured by default in samples and so the default QoS for sample WebLogic Server Pod's is `burstable`.
158208

159-
If you wish to set resource requests or limits differently on a sample Domain YAML file or template, see [Setting resource requests and limits in a Domain resource](#setting-resource-requests-and-limits-in-a-domain). Or, for samples that generate their Domain resource using an 'inputs' file, see the `serverPodMemoryRequest`, `serverPodMemoryLimit`, `serverPodCpuRequest`, and `serverPodCpuLimit` parameters in the sample's `create-domain.sh` input file.
209+
If you wish to set resource requests or limits differently on a sample Domain YAML file or template, see [Setting resource requests and limits in a Domain resource](#setting-resource-requests-and-limits-in-a-domain-resource). Or, for samples that generate their Domain resource using an "inputs" YAML file, see the `serverPodMemoryRequest`, `serverPodMemoryLimit`, `serverPodCpuRequest`, and `serverPodCpuLimit` parameters in the sample's `create-domain.sh` inputs file.
160210

161211
#### Configuring CPU affinity
162212

documentation/staging/content/samples/azure-kubernetes-service/domain-on-pv.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ We need to set up the domain configuration for the WebLogic domain.
301301
troubleshoot the reason and resolve it before proceeding to the next
302302
step.
303303

304-
{{% notice note %}} This sample creates WebLogic Server pods with reasonable values for memory, CPU, and JVM heap size (as a percentage of memory). You can supply different values. Edit `~/azure/weblogic-on-aks/domain1.yaml` and set the desired values for `serverPodMemoryRequest`, `serverPodMemoryLimit`, `serverPodCpuRequest`, `serverPodCpuLimit` and `javaOptions` before running `./create-domain.sh -i ~/azure/weblogic-on-aks/domain1.yaml -o ~/azure -e -v`.
304+
{{% notice note %}} This sample creates WebLogic Server Pods with reasonable values for memory, CPU, and JVM heap size (as a percentage of memory). These settings were determined by running a skeleton WebLogic domain with minimal or no deployed services and applications on potentially limited or heavily shared container environments. For advice about tuning CPU and memory requests and limits for broader use cases or in a production environment, see the [Pod memory and CPU resources](https://oracle.github.io/weblogic-kubernetes-operator/faq/resource-settings/) FAQ. To supply different values, edit `~/azure/weblogic-on-aks/domain1.yaml` and set the desired values for `serverPodMemoryRequest`, `serverPodMemoryLimit`, `serverPodCpuRequest`, `serverPodCpuLimit` and `javaOptions` before running `./create-domain.sh -i ~/azure/weblogic-on-aks/domain1.yaml -o ~/azure -e -v`.
305305
{{% /notice%}}
306306

307307
Here is an excerpt showing reasonable values:

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItIntrospectVersion.java

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -19,6 +19,7 @@
1919
import java.util.Properties;
2020

2121
import io.kubernetes.client.custom.V1Patch;
22+
import io.kubernetes.client.openapi.models.CoreV1Event;
2223
import io.kubernetes.client.openapi.models.V1Container;
2324
import io.kubernetes.client.openapi.models.V1EnvVar;
2425
import io.kubernetes.client.openapi.models.V1LocalObjectReference;
@@ -28,6 +29,7 @@
2829
import io.kubernetes.client.openapi.models.V1SecretReference;
2930
import io.kubernetes.client.openapi.models.V1Volume;
3031
import io.kubernetes.client.openapi.models.V1VolumeMount;
32+
import io.kubernetes.client.util.Yaml;
3133
import oracle.weblogic.domain.AdminServer;
3234
import oracle.weblogic.domain.AdminService;
3335
import oracle.weblogic.domain.Channel;
@@ -92,13 +94,19 @@
9294
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
9395
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.verifyCredentials;
9496
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.verifyServerCommunication;
97+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withStandardRetryPolicy;
9598
import static oracle.weblogic.kubernetes.utils.ConfigMapUtils.createConfigMapForDomainCreation;
9699
import static oracle.weblogic.kubernetes.utils.DeployUtil.deployUsingRest;
97100
import static oracle.weblogic.kubernetes.utils.DomainUtils.createDomainAndVerify;
98101
import static oracle.weblogic.kubernetes.utils.ImageUtils.createSecretForBaseImages;
99102
import static oracle.weblogic.kubernetes.utils.ImageUtils.dockerLoginAndPushImageToRegistry;
100103
import static oracle.weblogic.kubernetes.utils.JobUtils.createDomainJob;
101104
import static oracle.weblogic.kubernetes.utils.JobUtils.getIntrospectJobName;
105+
import static oracle.weblogic.kubernetes.utils.K8sEvents.DOMAIN_ROLL_COMPLETED;
106+
import static oracle.weblogic.kubernetes.utils.K8sEvents.DOMAIN_ROLL_STARTING;
107+
import static oracle.weblogic.kubernetes.utils.K8sEvents.POD_CYCLE_STARTING;
108+
import static oracle.weblogic.kubernetes.utils.K8sEvents.checkEvent;
109+
import static oracle.weblogic.kubernetes.utils.K8sEvents.getOpGeneratedEvent;
102110
import static oracle.weblogic.kubernetes.utils.LoadBalancerUtils.createIngressForDomainAndVerify;
103111
import static oracle.weblogic.kubernetes.utils.LoadBalancerUtils.installAndVerifyNginx;
104112
import static oracle.weblogic.kubernetes.utils.OKDUtils.createRouteForOKD;
@@ -628,29 +636,25 @@ void testDomainIntrospectVersionRolling() {
628636
checkPodReady(managedServerPodNamePrefix + i, domainUid, introDomainNamespace);
629637
}
630638

631-
/* commented due to bug Bugs - OWLS-89879
632639
//verify the introspectVersion change causes the domain roll events to be logged
633640
logger.info("verify domain roll starting/pod cycle starting/domain roll completed events are logged");
634641
checkEvent(opNamespace, introDomainNamespace, domainUid, DOMAIN_ROLL_STARTING,
635642
"Normal", timestamp, withStandardRetryPolicy);
636643
checkEvent(opNamespace, introDomainNamespace, domainUid, POD_CYCLE_STARTING,
637644
"Normal", timestamp, withStandardRetryPolicy);
638645

639-
CoreV1Event event = getEvent(opNamespace, introDomainNamespace,
640-
domainUid, DOMAIN_ROLL_STARTING, "Normal", timestamp);
646+
CoreV1Event event = getOpGeneratedEvent(introDomainNamespace, DOMAIN_ROLL_STARTING, "Normal", timestamp);
641647
logger.info(Yaml.dump(event));
642648
logger.info("verify the event message contains the domain resource changed message");
643649
assertTrue(event.getMessage().contains("resource changed"));
644650

645-
event = getEvent(opNamespace, introDomainNamespace, domainUid, POD_CYCLE_STARTING, "Normal", timestamp);
651+
event = getOpGeneratedEvent(introDomainNamespace, POD_CYCLE_STARTING, "Normal", timestamp);
646652
logger.info(Yaml.dump(event));
647653
logger.info("verify the event message contains the property changed in domain resource");
648654
assertTrue(event.getMessage().contains("ADMIN_PORT"));
649655

650656
checkEvent(opNamespace, introDomainNamespace, domainUid, DOMAIN_ROLL_COMPLETED,
651657
"Normal", timestamp, withStandardRetryPolicy);
652-
*/
653-
654658

655659
// verify the admin port is changed to newAdminPort
656660
assertEquals(newAdminPort, assertDoesNotThrow(()

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorFmwUpgrade.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -223,12 +223,12 @@ void testOperatorFmwUpgradeFrom325ToLatest() {
223223
}
224224

225225
/**
226-
* Operator upgrade from 3.3.6 to latest with a FMW Domain.
226+
* Operator upgrade from 3.3.7 to latest with a FMW Domain.
227227
*/
228228
@Test
229-
@DisplayName("Upgrade Operator from 3.3.6 to latest")
230-
void testOperatorFmwUpgradeFrom336ToLatest() {
231-
installAndUpgradeOperator("3.3.6", "v8", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX);
229+
@DisplayName("Upgrade Operator from 3.3.7 to latest")
230+
void testOperatorFmwUpgradeFrom337ToLatest() {
231+
installAndUpgradeOperator("3.3.7", "v8", DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX);
232232
}
233233

234234
private void installAndUpgradeOperator(
@@ -447,7 +447,7 @@ private void createDomainCrAndVerify(String domainVersion,
447447
.adminService(new AdminService()
448448
.addChannelsItem(new Channel()
449449
.channelName("default")
450-
.nodePort(0))
450+
.nodePort(getNextFreePort()))
451451
.addChannelsItem(new Channel()
452452
.channelName("T3Channel")
453453
.nodePort(t3ChannelPort))))

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItOperatorWlsUpgrade.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;
@@ -168,14 +168,14 @@ void testOperatorWlsUpgradeFrom325ToLatest(String domainType) {
168168
}
169169

170170
/**
171-
* Operator upgrade from 3.3.6 to latest.
171+
* Operator upgrade from 3.3.7 to latest.
172172
*/
173173
@ParameterizedTest
174-
@DisplayName("Upgrade Operator from 3.3.6 to latest")
174+
@DisplayName("Upgrade Operator from 3.3.7 to latest")
175175
@ValueSource(strings = { "Image", "FromModel" })
176-
void testOperatorWlsUpgradeFrom336ToLatest(String domainType) {
177-
logger.info("Starting test testOperatorWlsUpgradeFrom336ToLatest with domain type {0}", domainType);
178-
installAndUpgradeOperator(domainType, "3.3.6", OLD_DOMAIN_VERSION, DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX);
176+
void testOperatorWlsUpgradeFrom337ToLatest(String domainType) {
177+
logger.info("Starting test testOperatorWlsUpgradeFrom337ToLatest with domain type {0}", domainType);
178+
installAndUpgradeOperator(domainType, "3.3.7", OLD_DOMAIN_VERSION, DEFAULT_EXTERNAL_SERVICE_NAME_SUFFIX);
179179
}
180180

181181
/**

integration-tests/src/test/java/oracle/weblogic/kubernetes/ItPodsRestart.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.weblogic.kubernetes;

kindtest.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
3939
usage() {
4040
echo "usage: ${script} [-v <version>] [-n <name>] [-s] [-o <directory>] [-t <tests>] [-c <name>] [-p true|false] [-x <number_of_threads>] [-d <wdt_download_url>] [-i <wit_download_url>] [-l <wle_download_url>] [-m <maven_profile_name>] [-h]"
4141
echo " -v Kubernetes version (optional) "
42-
echo " (default: 1.16, supported values depend on the kind version. See kindversions.properties) "
42+
echo " (default: 1.21, supported values depend on the kind version. See kindversions.properties) "
4343
echo " -n Kind cluster name (optional) "
4444
echo " (default: kind) "
4545
echo " -s Skip tests. If this option is specified then the cluster is created, but no tests are run. "
@@ -71,7 +71,7 @@ captureLogs() {
7171
kind export logs "${RESULT_ROOT}/kubelogs" --name "${kind_name}" --verbosity 99
7272
}
7373

74-
k8s_version="1.16"
74+
k8s_version="1.21"
7575
kind_name="kind"
7676
if [[ -z "${WORKSPACE}" ]]; then
7777
outdir="/scratch/${USER}/kindtest"

kindversions.properties

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
0.11_1.16.15=kindest/node:v1.16.15@sha256:430c03034cd856c1f1415d3e37faf35a3ea9c5aaa2812117b79e6903d1fc9651
5555
0.11_1.15=kindest/node:v1.15.12@sha256:8d575f056493c7778935dd855ded0e95c48cb2fab90825792e8fc9af61536bf9
5656
0.11_1.15.12=kindest/node:v1.15.12@sha256:8d575f056493c7778935dd855ded0e95c48cb2fab90825792e8fc9af61536bf9
57+
0.11.1_1.23=kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
58+
0.11.1_1.23.0=kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
59+
0.11.1_1.22=kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047
60+
0.11.1_1.22.0=kindest/node:v1.22.0@sha256:b8bda84bb3a190e6e028b1760d277454a72267a5454b57db34437c34a588d047
5761
0.11.1_1.21=kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
5862
0.11.1_1.21.1=kindest/node:v1.21.1@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6
5963
0.11.1_1.20=kindest/node:v1.20.7@sha256:cbeaf907fc78ac97ce7b625e4bf0de16e3ea725daf6b04f930bd14c67c671ff9

operator/src/main/java/oracle/kubernetes/operator/helpers/EventHelper.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2020, 2021, Oracle and/or its affiliates.
1+
// Copyright (c) 2020, 2022, Oracle and/or its affiliates.
22
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33

44
package oracle.kubernetes.operator.helpers;
@@ -56,7 +56,6 @@
5656
import static oracle.kubernetes.operator.EventConstants.POD_CYCLE_STARTING_EVENT;
5757
import static oracle.kubernetes.operator.EventConstants.POD_CYCLE_STARTING_PATTERN;
5858
import static oracle.kubernetes.operator.EventConstants.WEBLOGIC_OPERATOR_COMPONENT;
59-
import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.DOMAIN_FAILED;
6059
import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.NAMESPACE_WATCHING_STARTED;
6160
import static oracle.kubernetes.operator.helpers.EventHelper.EventItem.NAMESPACE_WATCHING_STOPPED;
6261
import static oracle.kubernetes.operator.helpers.NamespaceHelper.getOperatorNamespace;
@@ -805,10 +804,6 @@ public String toString() {
805804
return "EventData: " + eventItem;
806805
}
807806

808-
public static boolean isProcessingAbortedEvent(@NotNull EventData eventData) {
809-
return eventData.eventItem == DOMAIN_FAILED && DomainFailureReason.Aborted.equals(eventData.failureReason);
810-
}
811-
812807
/**
813808
* Get the UID from the domain metadata.
814809
*

0 commit comments

Comments
 (0)