Skip to content

Commit d617299

Browse files
rjeberhardankedia
andauthored
Backport failure threshold configuration (#2521)
* OWLS-91708 - Allow customization of successThreshold and failureThreshold in weblogic server liveness and readiness probe Co-authored-by: Anil Kedia <anil.kedia@oracle.com>
1 parent 39e22bf commit d617299

28 files changed

+535
-59
lines changed

documentation/domains/Domain.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,11 @@
715715
"ProbeTuning": {
716716
"type": "object",
717717
"properties": {
718+
"failureThreshold": {
719+
"description": "Number of times the check is performed before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe, the Pod will be marked Unready. Defaults to 1.",
720+
"type": "number",
721+
"minimum": 1
722+
},
718723
"periodSeconds": {
719724
"description": "The number of seconds between checks.",
720725
"type": "number"
@@ -723,6 +728,11 @@
723728
"description": "The number of seconds with no response that indicates a failure.",
724729
"type": "number"
725730
},
731+
"successThreshold": {
732+
"description": "Minimum number of times the check needs to pass for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness Probe.",
733+
"type": "number",
734+
"minimum": 1
735+
},
726736
"initialDelaySeconds": {
727737
"description": "The number of seconds before the first check is performed.",
728738
"type": "number"

documentation/domains/Domain.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,10 @@ The current status of the operation of the WebLogic domain. Updated automaticall
255255

256256
| Name | Type | Description |
257257
| --- | --- | --- |
258+
| `failureThreshold` | number | Number of times the check is performed before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe, the Pod will be marked Unready. Defaults to 1. |
258259
| `initialDelaySeconds` | number | The number of seconds before the first check is performed. |
259260
| `periodSeconds` | number | The number of seconds between checks. |
261+
| `successThreshold` | number | Minimum number of times the check needs to pass for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness Probe. |
260262
| `timeoutSeconds` | number | The number of seconds with no response that indicates a failure. |
261263

262264
### Shutdown

documentation/domains/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,11 @@
16361636
"ProbeTuning": {
16371637
"type": "object",
16381638
"properties": {
1639+
"failureThreshold": {
1640+
"description": "Number of times the check is performed before giving up. Giving up in case of liveness probe means restarting the container. In case of readiness probe, the Pod will be marked Unready. Defaults to 1.",
1641+
"type": "number",
1642+
"minimum": 1.0
1643+
},
16391644
"periodSeconds": {
16401645
"description": "The number of seconds between checks.",
16411646
"type": "number"
@@ -1644,6 +1649,11 @@
16441649
"description": "The number of seconds with no response that indicates a failure.",
16451650
"type": "number"
16461651
},
1652+
"successThreshold": {
1653+
"description": "Minimum number of times the check needs to pass for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness Probe.",
1654+
"type": "number",
1655+
"minimum": 1.0
1656+
},
16471657
"initialDelaySeconds": {
16481658
"description": "The number of seconds before the first check is performed.",
16491659
"type": "number"

documentation/staging/content/userguide/managing-domains/domain-lifecycle/liveness-readiness-probe-customization.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,21 @@ This document describes how to customize the liveness and readiness probes for W
1515

1616
#### Liveness probe customization
1717

18-
The liveness probe is configured to check that a server is alive by querying the Node Manager process. By default, the liveness probe is configured to check liveness every 45 seconds and to timeout after 5 seconds. If a pod fails the liveness probe, Kubernetes will restart that container.
18+
The liveness probe is configured to check that a server is alive by querying the Node Manager process. By default, the liveness probe is configured to check liveness every 45 seconds, to timeout after 5 seconds, and to perform the first check after 30 seconds. The default success and failure threshold values are 1. If a pod fails the liveness probe, Kubernetes will restart that container.
1919

20-
You can customize the liveness probe interval and timeout using the `livenessProbe` attribute under the `serverPod` element of the domain resource.
20+
You can customize the liveness probe initial delay, interval, timeout and failure threshold using the `livenessProbe` attribute under the `serverPod` element of the domain resource.
2121

22-
Following is an example configuration to change the liveness probe interval and timeout value.
22+
Following is an example configuration to change the liveness probe interval, timeout and failure threshold value.
2323
```yaml
2424
serverPod:
2525
livenessProbe:
2626
periodSeconds: 30
2727
timeoutSeconds: 10
28+
failureThreshold: 3
2829
```
2930
31+
**Note**: The liveness probe success threshold value must always be 1. See [Configure Probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes) in the Kubernetes documentation for more details.
32+
3033
After the liveness probe script (livenessProbe.sh) performs its normal checks, you can customize the liveness probe by specifying a custom script, which will be invoked by livenessProbe.sh. You can specify the custom script either by using the `livenessProbeCustomScript` attribute in the domain resource or by setting the `LIVENESS_PROBE_CUSTOM_SCRIPT` environment variable using the `env` attribute under the `serverPod` element (see the configuration examples below). If the custom script fails with a non-zero exit status, the liveness probe will fail and Kubernetes will restart the container.
3134

3235

@@ -82,12 +85,13 @@ The following operator-populated environment variables are available for use in
8285

8386
By default, the readiness probe is configured to use the WebLogic Server ReadyApp framework. The ReadyApp framework allows fine customization of the readiness probe by the application's participation in the framework. For more details, see [Using the ReadyApp Framework](https://docs.oracle.com/en/middleware/fusion-middleware/weblogic-server/12.2.1.4/depgd/managing.html#GUID-C98443B1-D368-4CA4-A7A4-97B86FFD3C28). The readiness probe is used to determine if the server is ready to accept user requests. The readiness is used to determine when a server should be included in a load balancer's endpoints, in the case of a rolling restart, when a restarted server is fully started, and for various other purposes.
8487

85-
By default, the readiness probe is configured to check readiness every 5 seconds and to timeout after 5 seconds. You can customize the readiness probe interval and timeout using the `readinessProbe` attribute under the `serverPod` element of the domain resource.
88+
By default, the readiness probe is configured to check readiness every 5 seconds, to timeout after 5 seconds, and to perform the first check after 30 seconds. The default success and failure thresholds values are 1. You can customize the readiness probe initial delay, interval, timeout, success and failure thresholds using the `readinessProbe` attribute under the `serverPod` element of the domain resource.
8689

87-
Following is an example configuration to change readiness probe interval and timeout value.
90+
Following is an example configuration to change readiness probe interval, timeout and failure threshold value.
8891
```yaml
8992
serverPod:
9093
readinessProbe:
9194
periodSeconds: 10
9295
timeoutSeconds: 10
96+
failureThreshold: 3
9397
```

0 commit comments

Comments
 (0)