Skip to content

Commit 22d0ba5

Browse files
Merge remote-tracking branch 'origin/develop' into java-integ-ingress-per-domain
merge to the latest develop branch
2 parents 6a197e8 + b8d7eb0 commit 22d0ba5

File tree

5 files changed

+28
-11
lines changed

5 files changed

+28
-11
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
@@ -213,7 +213,7 @@ public void verifyAdminServerExternalService(String username, String password) t
213213

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

@@ -364,11 +364,7 @@ public void callWebAppAndVerifyLoadBalancing(String webappName, boolean verifyLo
364364
if (!loadBalancer.equals("NONE")) {
365365
// url
366366
StringBuffer testAppUrl = new StringBuffer("http://");
367-
testAppUrl
368-
.append(TestUtils.getHostName())
369-
.append(":")
370-
.append(loadBalancerWebPort)
371-
.append("/");
367+
testAppUrl.append(getHostNameForCurl()).append(":").append(loadBalancerWebPort).append("/");
372368
if (loadBalancer.equals("APACHE")) {
373369
testAppUrl.append("weblogic/");
374370
}
@@ -600,7 +596,7 @@ public void verifyAdminConsoleViaLB() throws Exception {
600596
logger.info("This check is done only for APACHE load balancer");
601597
return;
602598
}
603-
String nodePortHost = TestUtils.getHostName();
599+
String nodePortHost = getHostNameForCurl();
604600
int nodePort = getAdminSericeLBNodePort();
605601
String responseBodyFile =
606602
userProjectsDir + "/weblogic-domains/" + domainUid + "/testconsole.response.body";
@@ -1129,4 +1125,25 @@ private String getNodePort() throws Exception {
11291125
+ "for the admin server in domain.");
11301126
}
11311127
}
1128+
1129+
private String getHostNameForCurl() throws Exception {
1130+
if (System.getenv("K8S_NODEPORT_HOST") != null) {
1131+
return System.getenv("K8S_NODEPORT_HOST");
1132+
} else {
1133+
// ExecResult result = ExecCommand.exec("hostname | awk -F. '{print $1}'");
1134+
ExecResult result1 =
1135+
ExecCommand.exec("kubectl get nodes -o=jsonpath='{range .items[0]}{.metadata.name}'");
1136+
if (result1.exitValue() != 0) {
1137+
throw new RuntimeException("FAILURE: Could not get K8s Node name");
1138+
}
1139+
ExecResult result2 =
1140+
ExecCommand.exec(
1141+
"nslookup " + result1.stdout() + " | grep \"^Name\" | awk '{ print $2 }'");
1142+
if (result2.stdout().trim().equals("")) {
1143+
return result1.stdout().trim();
1144+
} else {
1145+
return result2.stdout().trim();
1146+
}
1147+
}
1148+
}
11321149
}

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

0 commit comments

Comments
 (0)