Skip to content

Commit ccaaa61

Browse files
committed
Merge branch 'develop' into owls-71579
2 parents 0d8a519 + 35c5367 commit ccaaa61

File tree

6 files changed

+29
-14
lines changed

6 files changed

+29
-14
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/utils/Domain.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void verifyAdminServerExternalService(String username, String password) t
212212

213213
// logger.info("Inside verifyAdminServerExternalService");
214214
if (exposeAdminNodePort) {
215-
String nodePortHost = TestUtils.getHostName();
215+
String nodePortHost = getHostNameForCurl();
216216
String nodePort = getNodePort();
217217
logger.info("nodePortHost " + nodePortHost + " nodePort " + nodePort);
218218

@@ -363,11 +363,7 @@ public void callWebAppAndVerifyLoadBalancing(String webappName, boolean verifyLo
363363
if (!loadBalancer.equals("NONE")) {
364364
// url
365365
StringBuffer testAppUrl = new StringBuffer("http://");
366-
testAppUrl
367-
.append(TestUtils.getHostName())
368-
.append(":")
369-
.append(loadBalancerWebPort)
370-
.append("/");
366+
testAppUrl.append(getHostNameForCurl()).append(":").append(loadBalancerWebPort).append("/");
371367
if (loadBalancer.equals("APACHE")) {
372368
testAppUrl.append("weblogic/");
373369
}
@@ -599,7 +595,7 @@ public void verifyAdminConsoleViaLB() throws Exception {
599595
logger.info("This check is done only for APACHE load balancer");
600596
return;
601597
}
602-
String nodePortHost = TestUtils.getHostName();
598+
String nodePortHost = getHostNameForCurl();
603599
int nodePort = getAdminSericeLBNodePort();
604600
String responseBodyFile =
605601
userProjectsDir + "/weblogic-domains/" + domainUid + "/testconsole.response.body";
@@ -1112,4 +1108,25 @@ private String getNodePort() throws Exception {
11121108
+ "for the admin server in domain.");
11131109
}
11141110
}
1111+
1112+
private String getHostNameForCurl() throws Exception {
1113+
if (System.getenv("K8S_NODEPORT_HOST") != null) {
1114+
return System.getenv("K8S_NODEPORT_HOST");
1115+
} else {
1116+
// ExecResult result = ExecCommand.exec("hostname | awk -F. '{print $1}'");
1117+
ExecResult result1 =
1118+
ExecCommand.exec("kubectl get nodes -o=jsonpath='{range .items[0]}{.metadata.name}'");
1119+
if (result1.exitValue() != 0) {
1120+
throw new RuntimeException("FAILURE: Could not get K8s Node name");
1121+
}
1122+
ExecResult result2 =
1123+
ExecCommand.exec(
1124+
"nslookup " + result1.stdout() + " | grep \"^Name\" | awk '{ print $2 }'");
1125+
if (result2.stdout().trim().equals("")) {
1126+
return result1.stdout().trim();
1127+
} else {
1128+
return result2.stdout().trim();
1129+
}
1130+
}
1131+
}
11151132
}

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain-inputs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ productionModeEnabled: true
4747
# If this property is set, the create domain scripts will use the value specified, instead of the
4848
# default value, to tag the generated image and set the `image` in the domain YAML file.
4949
#
50-
# An unique value is required for each domain that is created using the scripts.
50+
# A unique value is required for each domain that is created using the scripts.
5151
#
5252
# If you are running the sample scripts from a machine that is remote to the Kubernetes cluster where
5353
# the domain is going to be running, you need to set this property to the image name that is intended

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The following prerequisites must be handled prior to running the create domain s
1010
* Make sure the WebLogic operator is running.
1111
* The operator requires WebLogic Server 12.2.1.3.0 with patch 29135930 applied. The existing WebLogic Docker image, `store/oracle/weblogic:12.2.1.3`, was updated on January 17, 2019, and has all the necessary patches applied; a `docker pull` is required if you pulled the image prior to that date. Refer to [WebLogic Docker images](../../../../../site/weblogic-docker-images.md) for details on how to obtain or create the image.
1212
* Create a Kubernetes namespace for the domain unless the intention is to use the default namespace.
13-
* In the same Kubernetes namespace, create the Kubernetes persistent volume where the domain home will be hosted, and the Kubernetes persistent volume claim for the domain. For samples to create a PV and PVC, see [Create sample PV and PVC](../../create-weblogic-domain-pv-pvc/README.md).
13+
* In the same Kubernetes namespace, create the Kubernetes persistent volume (PV) where the domain home will be hosted, and the Kubernetes persistent volume claim (PVC) for the domain. For samples to create a PV and PVC, see [Create sample PV and PVC](../../create-weblogic-domain-pv-pvc/README.md). By default, the `create-domain.sh` script creates a domain with the `domainUID` set to `domain1` and expects the PVC `domain1-weblogic-sample-pvc` to be present. You can create `domain1-weblogic-sample-pvc` using [create-pv-pvc.sh](../../create-weblogic-domain-pv-pvc/create-pv-pvc.sh) with an inputs file that has the `domainUID` set to `domain1`.
1414
* Create the Kubernetes secrets `username` and `password` of the admin account in the same Kubernetes namespace as the domain.
1515

1616
## Use the script to create a domain

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public abstract class PodStepContext extends StepContextBase {
6969
private static final String START_SERVER = "/weblogic-operator/scripts/startServer.sh";
7070
private static final String LIVENESS_PROBE = "/weblogic-operator/scripts/livenessProbe.sh";
7171

72-
private static final String READINESS_PATH = "/weblogic/";
72+
private static final String READINESS_PATH = "/weblogic/ready";
7373

7474
private final DomainPresenceInfo info;
7575
private final WlsDomainConfig domainTopology;

operator/src/test/java/oracle/kubernetes/operator/helpers/PodHelperTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ public void whenPodCreated_livenessProbeHasDefinedTuning() {
278278
@Test
279279
public void whenPodCreated_readinessProbeHasReadinessCommand() {
280280
V1HTTPGetAction getAction = getCreatedPodSpecContainer().getReadinessProbe().getHttpGet();
281-
assertThat(getAction.getPath(), equalTo("/weblogic/"));
281+
assertThat(getAction.getPath(), equalTo("/weblogic/ready"));
282282
assertThat(getAction.getPort().getIntValue(), equalTo(listenPort));
283283
}
284284

site/quickstart.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,8 @@ e. To confirm that the load balancer noticed the new Ingress and is successfully
235235
$ kubectl get po -n sample-domain1-ns -o wide
236236
```
237237

238-
**NOTE**: Be sure to include the trailing forward slash on the URL, otherwise the command won't work.
239-
240238
```
241-
$ curl -v -H 'host: sample-domain1.org' http://your.server.com:30305/weblogic/
239+
$ curl -v -H 'host: sample-domain1.org' http://your.server.com:30305/weblogic/ready
242240
* About to connect() to your.server.com port 30305 (#0)
243241
* Trying 10.196.1.64...
244242
* Connected to your.server.com (10.196.1.64) port 30305 (#0)

0 commit comments

Comments
 (0)