Skip to content

Commit ac94ef1

Browse files
committed
Merge remote-tracking branch 'origin/main' into release/4.0
2 parents e96a0e6 + fbfe384 commit ac94ef1

File tree

23 files changed

+474
-210
lines changed

23 files changed

+474
-210
lines changed

documentation/4.0/content/managing-domains/accessing-the-domain/istio/istio.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ spec:
175175
istio: ingressgateway
176176
servers:
177177
- hosts:
178-
- '*'
178+
- 'yourdomain.dns.com'
179179
port:
180180
name: http
181181
number: 80
@@ -190,7 +190,7 @@ spec:
190190
gateways:
191191
- domain1-gateway
192192
hosts:
193-
- '*'
193+
- 'yourdomain.dns.com'
194194
http:
195195
- match:
196196
- uri:
@@ -416,13 +416,13 @@ See Istio [Destination Rule](https://istio.io/latest/docs/reference/config/netwo
416416

417417
Ingress gateway provides similar functions to `Kubernetes Ingress` but with more advanced functionality.
418418

419-
For example, to configure an Ingress gateway for SSL termination at the gateway:
419+
I. For example, to configure an Ingress gateway for SSL termination at the gateway:
420420

421421
1. Create a TLS certificate and secret.
422422

423423
```text
424424
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/tls1.key -out /tmp/tls1.crt -subj "/CN=secure-domain.org"
425-
$ kubectl -n weblogic-domain1 create secret tls domain1-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt
425+
$ kubectl -n istio-system create secret tls domain1-tls-cert --key /tmp/tls1.key --cert /tmp/tls1.crt
426426
```
427427

428428
2. Create the Ingress gateway.
@@ -453,8 +453,36 @@ spec:
453453
hosts:
454454
- 'regular-domain.org'
455455
```
456+
457+
If you are accessing the WebLogic Console through a secure gateway with SSL termination at the gateway level, enable
458+
`WeblogicPluginEnabled` in the WebLogic domain and add the appropriate request headers. For example,
459+
460+
If you are using WDT, add the `resources` section in the model YAML file.
461+
462+
```text
463+
resources:
464+
WebAppContainer:
465+
WeblogicPluginEnabled: true
466+
```
467+
468+
If you are using WLST, set the `WeblogicPluginEnabled` for each server and cluster
469+
470+
```text
471+
set('WeblogicPluginEnabled',true)
472+
```
456473

457-
For example, to configure an Ingress gateway for SSL passthrough:
474+
Set the request headers in the virtual service: (Use `kubectl explain virtualservice.spec.http.route.headers` for help)
475+
476+
```text
477+
headers:
478+
request:
479+
remove: ['WL-Proxy-Client-IP', 'WL-Proxy-SSL']
480+
set:
481+
X-Forwarded-Proto: https
482+
WL-Proxy-SSL: 'true'
483+
```
484+
485+
II. For example, to configure an Ingress gateway for SSL passthrough:
458486

459487

460488
```text
@@ -483,4 +511,29 @@ spec:
483511
- 'regular-domain.org'
484512
```
485513

514+
The virtual service will then configure to match the `tls` rule.
515+
516+
```text
517+
apiVersion: networking.istio.io/v1alpha3
518+
kind: VirtualService
519+
metadata:
520+
name: sample-domain1-virtualservice
521+
namespace: sample-domain1-ns
522+
spec:
523+
gateways:
524+
- sample-domain1-gateway
525+
hosts:
526+
- secure-domain.org
527+
tls:
528+
- match:
529+
- port: 443
530+
sniHosts:
531+
- secure-domain.org
532+
route:
533+
- destination:
534+
host: sample-domain1-admin-server
535+
port:
536+
number: 9002
537+
```
538+
486539
See Istio [Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress).

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import oracle.weblogic.kubernetes.annotations.IntegrationTest;
3333
import oracle.weblogic.kubernetes.annotations.Namespaces;
3434
import oracle.weblogic.kubernetes.logging.LoggingFacade;
35+
import org.awaitility.core.ConditionFactory;
3536
import org.junit.jupiter.api.BeforeAll;
3637
import org.junit.jupiter.api.DisplayName;
3738
import org.junit.jupiter.api.MethodOrderer;
@@ -67,6 +68,7 @@
6768
import static oracle.weblogic.kubernetes.utils.ClusterUtils.stopCluster;
6869
import static oracle.weblogic.kubernetes.utils.CommonMiiTestUtils.verifyPodsNotRolled;
6970
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.checkPodReadyAndServiceExists;
71+
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createCustomConditionFactory;
7072
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
7173
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.testUntil;
7274
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.withLongRetryPolicy;
@@ -254,7 +256,8 @@ void testAddReplaceClusterResource() {
254256

255257
//verify the introspector pod is created and runs
256258
String introspectPodNameBase2 = getIntrospectJobName(domainUid);
257-
checkPodExists(introspectPodNameBase2, domainUid, domainNamespace);
259+
ConditionFactory customConditionFactory = createCustomConditionFactory(0, 1, 5);
260+
checkPodExists(customConditionFactory, introspectPodNameBase2, domainUid, domainNamespace);
258261
checkPodDoesNotExist(introspectPodNameBase2, domainUid, domainNamespace);
259262

260263
// check managed server pods from cluster-1 are shutdown
@@ -363,7 +366,8 @@ void testDomainStatusMatchesClusterResourceStatus() {
363366

364367
//verify the introspector pod is created and runs
365368
String introspectPodNameBase2 = getIntrospectJobName(domainUid);
366-
checkPodExists(introspectPodNameBase2, domainUid, domainNamespace);
369+
ConditionFactory customConditionFactory = createCustomConditionFactory(0, 1, 5);
370+
checkPodExists(customConditionFactory, introspectPodNameBase2, domainUid, domainNamespace);
367371
checkPodDoesNotExist(introspectPodNameBase2, domainUid, domainNamespace);
368372

369373
// check managed server pods from cluster-1 are shutdown

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,15 @@ void testRetryOccursAndErrorFromIntrospectorLoggedInOperator() throws Exception
404404
testUntil(() -> checkPodLogContainsRegex(createDomainFailedMsgRegex, operatorPodName, opNamespace),
405405
logger, "{0} is found in Operator log", createDomainFailedMsgRegex);
406406

407-
// verify that SEVERE and createDomainFailedMsgRegex message found in Operator log
407+
// verify that SEVERE and createDomainFailedMsgRegex message found in introspector log
408408
testUntil(() -> checkInUncompletedIntroPodLogContainsRegex(createDomainFailedMsgRegex,
409409
domainUid, domainNamespace),
410410
logger, "{0} is found in introspector log", createDomainFailedMsgRegex);
411411

412+
// verify that SEVERE and createDomainFailedMsgRegex message found in domain status
413+
testUntil(() -> findStringInDomainStatusMessage(domainNamespace, domainUid, createDomainFailedMsgRegex, "true"),
414+
logger, "{0} is found in domain status message", createDomainFailedMsgRegex);
415+
412416
Callable<Boolean> configMapExist = assertDoesNotThrow(() -> configMapExist(domainNamespace, badModelFileCm));
413417

414418
if (configMapExist.call().booleanValue()) {

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonTestUtils.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,19 @@ private static ConditionFactory createStandardRetryPolicyWithAtMost(long minutes
129129

130130
private static final String TMP_FILE_NAME = "temp-download-file.out";
131131

132+
/**
133+
* Create a condition factory with custom values for pollDelay, pollInterval and atMost time.
134+
*
135+
* @param polldelay starting delay before checking for the condition in seconds
136+
* @param pollInterval interval time between checking for the condition in seconds
137+
* @param atMostMinutes how long should it wait for the condition becomes true in minutes
138+
* @return ConditionFactory custom condition factory
139+
*/
140+
public static ConditionFactory createCustomConditionFactory(int polldelay, int pollInterval, int atMostMinutes) {
141+
return with().pollDelay(polldelay, SECONDS)
142+
.and().with().pollInterval(pollInterval, SECONDS)
143+
.atMost(atMostMinutes, MINUTES).await();
144+
}
132145

133146
/**
134147
* Test assertion using standard retry policy over time until it passes or the timeout expires.

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DomainUtils.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,14 +1212,25 @@ public static DomainResource getAndValidateInitialDomain(String domainNamespace,
12121212
* @return true if regex found, false otherwise.
12131213
*/
12141214
@Nonnull
1215-
public static boolean findStringInDomainStatusMessage(String domainNamespace, String domainUid, String regex) {
1215+
public static boolean findStringInDomainStatusMessage(String domainNamespace,
1216+
String domainUid,
1217+
String regex,
1218+
String... multupleMessage) {
12161219
// get the domain status message
12171220
StringBuffer getDomainInfoCmd = new StringBuffer(KUBERNETES_CLI + " get domain/");
12181221
getDomainInfoCmd
12191222
.append(domainUid)
12201223
.append(" -n ")
1221-
.append(domainNamespace)
1222-
.append(" -o jsonpath='{.status.message}' --ignore-not-found");
1224+
.append(domainNamespace);
1225+
1226+
if (multupleMessage.length == 0) {
1227+
// get single field of domain message
1228+
getDomainInfoCmd.append(" -o jsonpath='{.status.message}' --ignore-not-found");
1229+
} else {
1230+
// use [,] to get side by side multiple fields of the domain status message
1231+
getDomainInfoCmd.append(" -o jsonpath=\"{.status.conditions[*]['status', 'message']}\" --ignore-not-found");
1232+
}
1233+
12231234
getLogger().info("Command to get domain status message: " + getDomainInfoCmd);
12241235

12251236
CommandParams params = new CommandParams().defaults();

integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/PodUtils.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ public static void checkPodExists(String podName, String domainUid, String domai
9494
domainNamespace);
9595
}
9696

97+
/**
98+
* Check pod exists in the specified namespace.
99+
*
100+
* @param conditionFactory Configuration for Awaitility condition factory
101+
* @param podName pod name to check
102+
* @param domainUid the label the pod is decorated with
103+
* @param domainNamespace the domain namespace in which the domain exists
104+
*/
105+
public static void checkPodExists(ConditionFactory conditionFactory, String podName,
106+
String domainUid, String domainNamespace) {
107+
LoggingFacade logger = getLogger();
108+
testUntil(conditionFactory,
109+
assertDoesNotThrow(() -> podExists(podName, domainUid, domainNamespace),
110+
String.format("podExists failed with ApiException for pod %s in namespace %s",
111+
podName, domainNamespace)),
112+
logger,
113+
"pod {0} to be created in namespace {1}",
114+
podName,
115+
domainNamespace);
116+
}
117+
97118
/**
98119
* Check pod is ready.
99120
*

kubernetes/crd/cluster-crd.yaml

Lines changed: 1 addition & 3 deletions
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: 46ef88005b68d9fb13a122b63fece506c555770209221581cb056c15f1ac7e6a
8+
weblogic.sha256: 9f051b9b7805fc9100cf6490873e80b91671c7165960bfbcd6e8007ae171937f
99
name: clusters.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -526,8 +526,6 @@ spec:
526526
type: string
527527
fieldsType:
528528
type: string
529-
clusterName:
530-
type: string
531529
creationTimestamp:
532530
format: date-time
533531
type: string

kubernetes/crd/domain-crd.yaml

Lines changed: 1 addition & 7 deletions
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: 3a81ece5d88c85957a5d5e4a1b6c068cdca4355afd80a5a6598cbfade313871f
8+
weblogic.sha256: 50af6b0cfbe5da871bbeae4bb4fd91c6da38931a01817fa475801e63dbbbdcd5
99
name: domains.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -1024,8 +1024,6 @@ spec:
10241024
type: string
10251025
fieldsType:
10261026
type: string
1027-
clusterName:
1028-
type: string
10291027
creationTimestamp:
10301028
format: date-time
10311029
type: string
@@ -4014,8 +4012,6 @@ spec:
40144012
type: string
40154013
fieldsType:
40164014
type: string
4017-
clusterName:
4018-
type: string
40194015
creationTimestamp:
40204016
format: date-time
40214017
type: string
@@ -6842,8 +6838,6 @@ spec:
68426838
type: string
68436839
fieldsType:
68446840
type: string
6845-
clusterName:
6846-
type: string
68476841
creationTimestamp:
68486842
format: date-time
68496843
type: string

kubernetes/samples/scripts/common/domain-template.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# This is an example of how to define a Domain resource.
55
#
6-
apiVersion: "weblogic.oracle/v8"
6+
apiVersion: "weblogic.oracle/v9"
77
kind: Domain
88
metadata:
99
name: %DOMAIN_UID%
@@ -83,12 +83,26 @@ spec:
8383
# Uncomment to export the T3Channel as a service
8484
%EXPOSE_T3_CHANNEL_PREFIX% - channelName: T3Channel
8585

86-
# clusters is used to configure the desired behavior for starting member servers of a cluster.
87-
# If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters.
86+
# References to Cluster resources that describe the lifecycle options for all
87+
# the Managed Server members of a WebLogic cluster, including Java
88+
# options, environment variables, additional Pod content, and the ability to
89+
# explicitly start, stop, or restart cluster members. The Cluster resource
90+
# must describe a cluster that already exists in the WebLogic domain
91+
# configuration.
8892
clusters:
89-
- clusterName: %CLUSTER_NAME%
90-
replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
93+
- name: %DOMAIN_UID%-%CLUSTER_NAME%
94+
9195
# The number of managed servers to start for unlisted clusters
9296
# replicas: 1
9397

98+
---
99+
# This is an example of how to define a Cluster resource.
100+
apiVersion: weblogic.oracle/v1
101+
kind: Cluster
102+
metadata:
103+
name: %DOMAIN_UID%-%CLUSTER_NAME%
104+
namespace: %NAMESPACE%
105+
spec:
106+
clusterName: %CLUSTER_NAME%
107+
replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
94108

kubernetes/samples/scripts/common/jrf-domain-template.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# This is an example of how to define a Domain resource.
55
#
6-
apiVersion: "weblogic.oracle/v8"
6+
apiVersion: "weblogic.oracle/v9"
77
kind: Domain
88
metadata:
99
name: %DOMAIN_UID%
@@ -49,11 +49,11 @@ spec:
4949
# data storage directories are determined from the WebLogic domain home configuration.
5050
dataHome: "%DATA_HOME%"
5151

52-
# serverStartPolicy legal values are "NEVER", "IF_NEEDED", or "ADMIN_ONLY"
52+
# serverStartPolicy legal values are "Never, "IfNeeded", or "AdminOnly"
5353
# This determines which WebLogic Servers the Operator will start up when it discovers this Domain
54-
# - "NEVER" will not start any server in the domain
55-
# - "ADMIN_ONLY" will start up only the administration server (no managed servers will be started)
56-
# - "IF_NEEDED" will start all non-clustered servers, including the administration server and clustered servers up to the replica count
54+
# - "Never" will not start any server in the domain
55+
# - "AdminOnly" will start up only the administration server (no managed servers will be started)
56+
# - "IfNeeded" will start all non-clustered servers, including the administration server and clustered servers up to the replica count
5757
serverStartPolicy: %SERVER_START_POLICY%
5858

5959
serverPod:
@@ -87,12 +87,26 @@ spec:
8787
- name: USER_MEM_ARGS
8888
value: "-Djava.security.egd=file:/dev/./urandom -Xms512m -Xmx1024m "
8989

90-
# clusters is used to configure the desired behavior for starting member servers of a cluster.
91-
# If you use this entry, then the rules will be applied to ALL servers that are members of the named clusters.
90+
# References to Cluster resources that describe the lifecycle options for all
91+
# the Managed Server members of a WebLogic cluster, including Java
92+
# options, environment variables, additional Pod content, and the ability to
93+
# explicitly start, stop, or restart cluster members. The Cluster resource
94+
# must describe a cluster that already exists in the WebLogic domain
95+
# configuration.
9296
clusters:
93-
- clusterName: %CLUSTER_NAME%
94-
replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
97+
- name: %DOMAIN_UID%-%CLUSTER_NAME%
98+
9599
# The number of managed servers to start for unlisted clusters
96100
# replicas: 1
97101

102+
---
103+
# This is an example of how to define a Cluster resource.
104+
apiVersion: weblogic.oracle/v1
105+
kind: Cluster
106+
metadata:
107+
name: %DOMAIN_UID%-%CLUSTER_NAME%
108+
namespace: %NAMESPACE%
109+
spec:
110+
clusterName: %CLUSTER_NAME%
111+
replicas: %INITIAL_MANAGED_SERVER_REPLICAS%
98112

0 commit comments

Comments
 (0)