Skip to content

Commit ff66537

Browse files
committed
Merge branch 'cherry-pick-f0f13fa7' into 'release/4.2'
Cherry-pick branch 'startup-probes' into 'release/4.2' See merge request weblogic-cloud/weblogic-kubernetes-operator!4750
2 parents 46cb68c + 1931802 commit ff66537

File tree

12 files changed

+327
-7
lines changed

12 files changed

+327
-7
lines changed

documentation/domains/Cluster.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,10 @@
205205
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.28.2/_definitions.json#/definitions/io.k8s.api.core.v1.HostAlias"
206206
}
207207
},
208+
"startupProbe": {
209+
"description": "Settings for the startup probe associated with a WebLogic Server instance. If not specified, the operator will not create a default startup probe.",
210+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.28.2/_definitions.json#/definitions/io.k8s.api.core.v1.Probe"
211+
},
208212
"nodeSelector": {
209213
"description": "Selector which must match a Node\u0027s labels for the Pod to be scheduled on that Node. See `kubectl explain pods.spec.nodeSelector`.",
210214
"additionalProperties": {

documentation/domains/Cluster.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The specification of the operation of the WebLogic cluster. Required.
7777
| `schedulerName` | string | If specified, the Pod will be dispatched by the specified scheduler. If not specified, the Pod will be dispatched by the default scheduler. See `kubectl explain pods.spec.schedulerName`. |
7878
| `serviceAccountName` | string | Name of the ServiceAccount to be used to run this Pod. If it is not set, default ServiceAccount will be used. The ServiceAccount has to exist at the time the Pod is created. See `kubectl explain pods.spec.serviceAccountName`. |
7979
| `shutdown` | [Shutdown](#shutdown) | Configures how the operator should shut down the server instance. |
80+
| `startupProbe` | [Probe](k8s1.28.2.md#probe) | Settings for the startup probe associated with a WebLogic Server instance. If not specified, the operator will not create a default startup probe. |
8081
| `tolerations` | Array of [Toleration](k8s1.28.2.md#toleration) | If specified, the Pod's tolerations. See `kubectl explain pods.spec.tolerations`. |
8182
| `topologySpreadConstraints` | Array of [Topology Spread Constraint](k8s1.28.2.md#topology-spread-constraint) | TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. |
8283
| `volumeMounts` | Array of [Volume Mount](k8s1.28.2.md#volume-mount) | Additional volume mounts for the container running a WebLogic Server instance. See `kubectl explain pods.spec.containers.volumeMounts`. |

documentation/domains/Domain.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,10 @@
10661066
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.28.2/_definitions.json#/definitions/io.k8s.api.core.v1.HostAlias"
10671067
}
10681068
},
1069+
"startupProbe": {
1070+
"description": "Settings for the startup probe associated with a WebLogic Server instance. If not specified, the operator will not create a default startup probe.",
1071+
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/v1.28.2/_definitions.json#/definitions/io.k8s.api.core.v1.Probe"
1072+
},
10691073
"nodeSelector": {
10701074
"description": "Selector which must match a Node\u0027s labels for the Pod to be scheduled on that Node. See `kubectl explain pods.spec.nodeSelector`.",
10711075
"additionalProperties": {

documentation/domains/Domain.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ The current status of the operation of the WebLogic domain. Updated automaticall
178178
| `schedulerName` | string | If specified, the Pod will be dispatched by the specified scheduler. If not specified, the Pod will be dispatched by the default scheduler. See `kubectl explain pods.spec.schedulerName`. |
179179
| `serviceAccountName` | string | Name of the ServiceAccount to be used to run this Pod. If it is not set, default ServiceAccount will be used. The ServiceAccount has to exist at the time the Pod is created. See `kubectl explain pods.spec.serviceAccountName`. |
180180
| `shutdown` | [Shutdown](#shutdown) | Configures how the operator should shut down the server instance. |
181+
| `startupProbe` | [Probe](k8s1.28.2.md#probe) | Settings for the startup probe associated with a WebLogic Server instance. If not specified, the operator will not create a default startup probe. |
181182
| `tolerations` | Array of [Toleration](k8s1.28.2.md#toleration) | If specified, the Pod's tolerations. See `kubectl explain pods.spec.tolerations`. |
182183
| `topologySpreadConstraints` | Array of [Topology Spread Constraint](k8s1.28.2.md#topology-spread-constraint) | TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. All topologySpreadConstraints are ANDed. |
183184
| `volumeMounts` | Array of [Volume Mount](k8s1.28.2.md#volume-mount) | Additional volume mounts for the container running a WebLogic Server instance. See `kubectl explain pods.spec.containers.volumeMounts`. |

documentation/site/content/managing-domains/domain-lifecycle/startup.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ The operator will restart servers when any of the follow fields on the Domain th
287287
* `readinessProbe`
288288
* `resources`
289289
* `restartVersion`
290+
* `startupProbe`
290291
* `volumes`
291292
* `volumeMounts`
292293

kubernetes/crd/cluster-crd.yaml

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: 25a60de9429ea0f9bad45b3083d18c9ff56c86c62a123cdff67af4bacf82eec5
8+
weblogic.sha256: 2f9c1cd88595595fecef563dbc9a149f318eab7146b63cb6142c45279ad4f9e7
99
name: clusters.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -207,6 +207,74 @@ spec:
207207
items:
208208
type: string
209209
type: array
210+
startupProbe:
211+
description: Settings for the startup probe associated with a
212+
WebLogic Server instance. If not specified, the operator will
213+
not create a default startup probe.
214+
properties:
215+
terminationGracePeriodSeconds:
216+
type: integer
217+
failureThreshold:
218+
type: integer
219+
periodSeconds:
220+
type: integer
221+
tcpSocket:
222+
properties:
223+
port:
224+
x-kubernetes-int-or-string: true
225+
host:
226+
type: string
227+
required:
228+
- port
229+
type: object
230+
timeoutSeconds:
231+
type: integer
232+
successThreshold:
233+
type: integer
234+
initialDelaySeconds:
235+
type: integer
236+
exec:
237+
properties:
238+
command:
239+
items:
240+
type: string
241+
type: array
242+
type: object
243+
grpc:
244+
properties:
245+
port:
246+
type: integer
247+
service:
248+
type: string
249+
required:
250+
- port
251+
type: object
252+
httpGet:
253+
properties:
254+
path:
255+
type: string
256+
scheme:
257+
type: string
258+
port:
259+
x-kubernetes-int-or-string: true
260+
host:
261+
type: string
262+
httpHeaders:
263+
items:
264+
type: object
265+
properties:
266+
name:
267+
type: string
268+
value:
269+
type: string
270+
required:
271+
- name
272+
- value
273+
type: array
274+
required:
275+
- port
276+
type: object
277+
type: object
210278
nodeSelector:
211279
additionalProperties:
212280
type: string

kubernetes/crd/domain-crd.yaml

Lines changed: 205 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: ee0c6f79288b000cd61aa9438ab7f24f63b6334072e3520f25ee454f8bff6175
8+
weblogic.sha256: b48d0f17054d017bd3d9df2d30929bab24882235a628b715f59092f288dd569e
99
name: domains.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -1301,6 +1301,74 @@ spec:
13011301
items:
13021302
type: string
13031303
type: array
1304+
startupProbe:
1305+
description: Settings for the startup probe associated with
1306+
a WebLogic Server instance. If not specified, the operator
1307+
will not create a default startup probe.
1308+
properties:
1309+
terminationGracePeriodSeconds:
1310+
type: integer
1311+
failureThreshold:
1312+
type: integer
1313+
periodSeconds:
1314+
type: integer
1315+
tcpSocket:
1316+
properties:
1317+
port:
1318+
x-kubernetes-int-or-string: true
1319+
host:
1320+
type: string
1321+
required:
1322+
- port
1323+
type: object
1324+
timeoutSeconds:
1325+
type: integer
1326+
successThreshold:
1327+
type: integer
1328+
initialDelaySeconds:
1329+
type: integer
1330+
exec:
1331+
properties:
1332+
command:
1333+
items:
1334+
type: string
1335+
type: array
1336+
type: object
1337+
grpc:
1338+
properties:
1339+
port:
1340+
type: integer
1341+
service:
1342+
type: string
1343+
required:
1344+
- port
1345+
type: object
1346+
httpGet:
1347+
properties:
1348+
path:
1349+
type: string
1350+
scheme:
1351+
type: string
1352+
port:
1353+
x-kubernetes-int-or-string: true
1354+
host:
1355+
type: string
1356+
httpHeaders:
1357+
items:
1358+
type: object
1359+
properties:
1360+
name:
1361+
type: string
1362+
value:
1363+
type: string
1364+
required:
1365+
- name
1366+
- value
1367+
type: array
1368+
required:
1369+
- port
1370+
type: object
1371+
type: object
13041372
nodeSelector:
13051373
additionalProperties:
13061374
type: string
@@ -4482,6 +4550,74 @@ spec:
44824550
items:
44834551
type: string
44844552
type: array
4553+
startupProbe:
4554+
description: Settings for the startup probe associated with a
4555+
WebLogic Server instance. If not specified, the operator will
4556+
not create a default startup probe.
4557+
properties:
4558+
terminationGracePeriodSeconds:
4559+
type: integer
4560+
failureThreshold:
4561+
type: integer
4562+
periodSeconds:
4563+
type: integer
4564+
tcpSocket:
4565+
properties:
4566+
port:
4567+
x-kubernetes-int-or-string: true
4568+
host:
4569+
type: string
4570+
required:
4571+
- port
4572+
type: object
4573+
timeoutSeconds:
4574+
type: integer
4575+
successThreshold:
4576+
type: integer
4577+
initialDelaySeconds:
4578+
type: integer
4579+
exec:
4580+
properties:
4581+
command:
4582+
items:
4583+
type: string
4584+
type: array
4585+
type: object
4586+
grpc:
4587+
properties:
4588+
port:
4589+
type: integer
4590+
service:
4591+
type: string
4592+
required:
4593+
- port
4594+
type: object
4595+
httpGet:
4596+
properties:
4597+
path:
4598+
type: string
4599+
scheme:
4600+
type: string
4601+
port:
4602+
x-kubernetes-int-or-string: true
4603+
host:
4604+
type: string
4605+
httpHeaders:
4606+
items:
4607+
type: object
4608+
properties:
4609+
name:
4610+
type: string
4611+
value:
4612+
type: string
4613+
required:
4614+
- name
4615+
- value
4616+
type: array
4617+
required:
4618+
- port
4619+
type: object
4620+
type: object
44854621
nodeSelector:
44864622
additionalProperties:
44874623
type: string
@@ -7303,6 +7439,74 @@ spec:
73037439
type: array
73047440
items:
73057441
type: string
7442+
startupProbe:
7443+
description: Settings for the startup probe associated with
7444+
a WebLogic Server instance. If not specified, the operator
7445+
will not create a default startup probe.
7446+
type: object
7447+
properties:
7448+
terminationGracePeriodSeconds:
7449+
type: integer
7450+
failureThreshold:
7451+
type: integer
7452+
periodSeconds:
7453+
type: integer
7454+
tcpSocket:
7455+
type: object
7456+
properties:
7457+
port:
7458+
x-kubernetes-int-or-string: true
7459+
host:
7460+
type: string
7461+
required:
7462+
- port
7463+
timeoutSeconds:
7464+
type: integer
7465+
successThreshold:
7466+
type: integer
7467+
initialDelaySeconds:
7468+
type: integer
7469+
exec:
7470+
type: object
7471+
properties:
7472+
command:
7473+
type: array
7474+
items:
7475+
type: string
7476+
grpc:
7477+
type: object
7478+
properties:
7479+
port:
7480+
type: integer
7481+
service:
7482+
type: string
7483+
required:
7484+
- port
7485+
httpGet:
7486+
type: object
7487+
properties:
7488+
path:
7489+
type: string
7490+
scheme:
7491+
type: string
7492+
port:
7493+
x-kubernetes-int-or-string: true
7494+
host:
7495+
type: string
7496+
httpHeaders:
7497+
type: array
7498+
items:
7499+
type: object
7500+
properties:
7501+
name:
7502+
type: string
7503+
value:
7504+
type: string
7505+
required:
7506+
- name
7507+
- value
7508+
required:
7509+
- port
73067510
nodeSelector:
73077511
description: Selector which must match a Node's labels for
73087512
the Pod to be scheduled on that Node. See `kubectl explain

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,8 @@ protected V1Container createPrimaryContainer() {
752752
V1Container v1Container = super.createPrimaryContainer()
753753
.ports(getContainerPorts())
754754
.lifecycle(createLifecycle())
755-
.livenessProbe(createLivenessProbe(podTuning));
755+
.livenessProbe(createLivenessProbe(podTuning))
756+
.startupProbe(getStartupProbe());
756757

757758
if (!mockWls()) {
758759
v1Container.readinessProbe(createReadinessProbe(podTuning));
@@ -1003,6 +1004,10 @@ private V1Probe getLivenessProbe() {
10031004
.map(V1ProbeBuilder::new).map(V1ProbeBuilder::build).orElse(new V1Probe());
10041005
}
10051006

1007+
private V1Probe getStartupProbe() {
1008+
return getServerSpec().getStartupProbe();
1009+
}
1010+
10061011
private boolean mockWls() {
10071012
return Boolean.getBoolean("mockWLS");
10081013
}

operator/src/main/java/oracle/kubernetes/operator/processing/EffectiveServerSpec.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public interface EffectiveServerSpec {
9393
@Nonnull
9494
V1Probe getReadinessProbe();
9595

96+
V1Probe getStartupProbe();
97+
9698
@Nonnull
9799
Shutdown getShutdown();
98100

0 commit comments

Comments
 (0)