Skip to content

Commit bf8b1db

Browse files
sankarpnddsharpe
authored andcommitted
backport MRs 4676, 4671, 4662 to release/4.2
1 parent 36a6461 commit bf8b1db

14 files changed

+449
-141
lines changed

Jenkinsfile.podman

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def kind_k8s_map = [
2020
]
2121
]
2222
def _kind_image = null
23-
CRON_SETTINGS = '''H 1 * * * % MAVEN_PROFILE_NAME=kind-parallel'''
23+
CRON_SETTINGS = '''H 1 * * * % MAVEN_PROFILE_NAME=kind-parallel
24+
H 2 * * * % MAVEN_PROFILE_NAME=kind-sequential'''
2425

2526
pipeline {
2627
agent { label 'large-ol9' }
@@ -373,6 +374,9 @@ pipeline {
373374
if kind delete cluster --name ${kind_name} --kubeconfig "${kubeconfig_file}"; then
374375
echo "Deleted orphaned kind cluster ${kind_name}"
375376
fi
377+
# settings needed by elastic logging tests
378+
echo "running sudo sysctl -w vm.max_map_count=262144"
379+
sudo sysctl -w vm.max_map_count=262144
376380
cat <<EOF | kind create cluster --name "${kind_name}" --kubeconfig "${kubeconfig_file}" --config=-
377381
kind: Cluster
378382
apiVersion: kind.x-k8s.io/v1alpha4
@@ -431,6 +435,21 @@ nodes:
431435
- containerPort: 32343
432436
hostPort: 2343
433437
protocol: TCP
438+
- containerPort: 32331
439+
hostPort: 2331
440+
protocol: TCP
441+
- containerPort: 31781
442+
hostPort: 2781
443+
protocol: TCP
444+
- containerPort: 31744
445+
hostPort: 2782
446+
protocol: TCP
447+
- containerPort: 31785
448+
hostPort: 2785
449+
protocol: TCP
450+
- containerPort: 31746
451+
hostPort: 2786
452+
protocol: TCP
434453
extraMounts:
435454
- hostPath: ${pv_root}
436455
containerPath: ${pv_root}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ public static void init(@Namespaces(2) List<String> namespaces) {
122122
"elasticsearch:7.8.1", ELASTICSEARCH_IMAGE),"Failed to replace String: " + ELASTICSEARCH_IMAGE);
123123
assertDoesNotThrow(() -> replaceStringInFile(destELKConfigFilePath.toString(),
124124
"kibana:7.8.1", KIBANA_IMAGE),"Failed to replace String: " + KIBANA_IMAGE);
125+
if (TestConstants.KIND_CLUSTER
126+
&& !TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT)) {
127+
assertDoesNotThrow(() -> replaceStringInFile(destELKConfigFilePath.toString(),
128+
"'-w', 'vm.max_map_count=262144'", "'vm.max_map_count'"),
129+
"Failed to replace String: " + "'-w', 'vm.max_map_count=262144'");
130+
}
125131

126132
// install and verify Elasticsearch and Kibana;
127133
elasticSearchHost = "elasticsearch." + elasticSearchNs + ".svc.cluster.local";

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

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
package oracle.weblogic.kubernetes;
55

66
import java.io.IOException;
7+
import java.net.InetAddress;
8+
import java.net.UnknownHostException;
79
import java.nio.file.Files;
810
import java.nio.file.Path;
911
import java.nio.file.Paths;
@@ -47,13 +49,21 @@
4749
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
4850
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_SERVER_NAME_BASE;
4951
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
52+
import static oracle.weblogic.kubernetes.TestConstants.ITHPACUSTOMNGINX_INGRESS_HTTPS_NODEPORT;
53+
import static oracle.weblogic.kubernetes.TestConstants.ITHPACUSTOMNGINX_INGRESS_HTTP_HOSTPORT;
54+
import static oracle.weblogic.kubernetes.TestConstants.ITHPACUSTOMNGINX_INGRESS_HTTP_NODEPORT;
5055
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
56+
import static oracle.weblogic.kubernetes.TestConstants.KIND_CLUSTER;
5157
import static oracle.weblogic.kubernetes.TestConstants.KUBERNETES_CLI;
5258
import static oracle.weblogic.kubernetes.TestConstants.MANAGED_SERVER_NAME_BASE;
59+
import static oracle.weblogic.kubernetes.TestConstants.NGINX_CHART_VERSION;
60+
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
5361
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER_PRIVATEIP;
5462
import static oracle.weblogic.kubernetes.TestConstants.PROMETHEUS_CHART_VERSION;
5563
import static oracle.weblogic.kubernetes.TestConstants.RESULTS_ROOT;
5664
import static oracle.weblogic.kubernetes.TestConstants.TEST_IMAGES_REPO_SECRET_NAME;
65+
import static oracle.weblogic.kubernetes.TestConstants.WLSIMG_BUILDER;
66+
import static oracle.weblogic.kubernetes.TestConstants.WLSIMG_BUILDER_DEFAULT;
5767
import static oracle.weblogic.kubernetes.actions.ActionConstants.MODEL_DIR;
5868
import static oracle.weblogic.kubernetes.actions.ActionConstants.RESOURCE_DIR;
5969
import static oracle.weblogic.kubernetes.actions.TestActions.deletePersistentVolume;
@@ -212,7 +222,8 @@ public static void initAll(@Namespaces(4) List<String> namespaces) {
212222
);
213223

214224
// install and verify NGINX
215-
nginxHelmParams = installAndVerifyNginx(nginxNamespace, 0, 0);
225+
nginxHelmParams = installAndVerifyNginx(nginxNamespace, ITHPACUSTOMNGINX_INGRESS_HTTP_NODEPORT,
226+
ITHPACUSTOMNGINX_INGRESS_HTTPS_NODEPORT, NGINX_CHART_VERSION, (OKE_CLUSTER ? null : "NodePort"));
216227

217228
String nginxServiceName = nginxHelmParams.getHelmParams().getReleaseName() + "-ingress-nginx-controller";
218229
logger.info("NGINX service name: {0}", nginxServiceName);
@@ -221,6 +232,14 @@ public static void initAll(@Namespaces(4) List<String> namespaces) {
221232
String host = formatIPv6Host(K8S_NODEPORT_HOST);
222233
ingressIP = getServiceExtIPAddrtOke(nginxServiceName, nginxNamespace) != null
223234
? getServiceExtIPAddrtOke(nginxServiceName, nginxNamespace) : host;
235+
if (KIND_CLUSTER && !WLSIMG_BUILDER.equals(WLSIMG_BUILDER_DEFAULT)) {
236+
try {
237+
ingressIP = formatIPv6Host(InetAddress.getLocalHost().getHostAddress());
238+
} catch (UnknownHostException ex) {
239+
logger.severe(ex.getLocalizedMessage());
240+
}
241+
nodeportshttp = ITHPACUSTOMNGINX_INGRESS_HTTP_HOSTPORT;
242+
}
224243

225244
// create cluster resouce with limits and requests in serverPod
226245
ClusterResource clusterResource =
@@ -289,6 +308,15 @@ void testHPAWithCustomMetrics() {
289308
//invoke app 20 times to generate metrics with number of opened sessions > 5
290309
String host = formatIPv6Host(K8S_NODEPORT_HOST);
291310
String hostPort = OKE_CLUSTER_PRIVATEIP ? ingressIP : host + ":" + nodeportshttp;
311+
if (KIND_CLUSTER && !WLSIMG_BUILDER.equals(WLSIMG_BUILDER_DEFAULT)) {
312+
try {
313+
host = formatIPv6Host(InetAddress.getLocalHost().getHostAddress());
314+
} catch (UnknownHostException ex) {
315+
logger.severe(ex.getLocalizedMessage());
316+
}
317+
nodeportshttp = ITHPACUSTOMNGINX_INGRESS_HTTP_HOSTPORT;
318+
hostPort = host + ":" + nodeportshttp;
319+
}
292320
String curlCmd =
293321
String.format("curl --silent --show-error --noproxy '*' -H 'host: %s' http://%s:%s@%s/" + SESSMIGT_APP_URL,
294322
ingressHostList.get(0),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ private DomainResource createDomainResourceWithConfigMap(String domainUid, Strin
15691569
}
15701570

15711571
private void updateIngressBackendServicePort(int newAdminPort) throws ApiException {
1572-
String ingressName = introDomainNamespace + "-" + domainUid + "-" + adminServerName;
1572+
String ingressName = introDomainNamespace + "-" + domainUid + "-" + adminServerName + "-7001";
15731573
V1Ingress ingress = Ingress.getIngress(introDomainNamespace, ingressName).orElse(null);
15741574
if (ingress != null) {
15751575
logger.info("Updating ingress {0} with new admin port {1}", ingressName, newAdminPort);
@@ -1578,7 +1578,7 @@ private void updateIngressBackendServicePort(int newAdminPort) throws ApiExcepti
15781578
.setPort(new V1ServiceBackendPort().number(newAdminPort));
15791579
updateIngress(introDomainNamespace, ingress);
15801580
} else {
1581-
fail("Failed to update ingress");
1581+
fail("Ingress is null, failed to update ingress");
15821582
}
15831583
}
15841584

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

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44
package oracle.weblogic.kubernetes;
55

6+
7+
import java.net.InetAddress;
8+
import java.net.UnknownHostException;
69
import java.nio.file.Path;
710
import java.nio.file.Paths;
811
import java.util.ArrayList;
@@ -24,7 +27,11 @@
2427

2528
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
2629
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
30+
import static oracle.weblogic.kubernetes.TestConstants.ISTIO_HTTP_HOSTPORT;
31+
import static oracle.weblogic.kubernetes.TestConstants.IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_CONAINERPORT;
32+
import static oracle.weblogic.kubernetes.TestConstants.IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_HOSTPORT;
2733
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
34+
import static oracle.weblogic.kubernetes.TestConstants.OCNE;
2835
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
2936
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER_PRIVATEIP;
3037
import static oracle.weblogic.kubernetes.TestConstants.RESULTS_ROOT;
@@ -38,7 +45,6 @@
3845
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createTestWebAppWarFile;
3946
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.formatIPv6Host;
4047
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getImageBuilderExtraArgs;
41-
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
4248
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getServiceExtIPAddrtOke;
4349
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.startPortForwardProcess;
4450
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.stopPortForwardProcess;
@@ -140,7 +146,7 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
140146

141147
// install and verify operator
142148
installAndVerifyOperator(opNamespace, domain1Namespace, domain2Namespace);
143-
prometheusPort = getNextFreePort();
149+
prometheusPort = IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_CONAINERPORT;
144150
}
145151

146152
/**
@@ -223,6 +229,14 @@ private void deployPrometheusAndVerify(String domainNamespace, String domainUid,
223229
// In internal OKE env, use Istio EXTERNAL-IP; in non-OKE env, use K8S_NODEPORT_HOST + ":" + istioIngressPort
224230
hostPortPrometheus = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
225231
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) : host + ":" + prometheusPort;
232+
if (!TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT) && !OCNE) {
233+
try {
234+
hostPortPrometheus = InetAddress.getLocalHost().getHostAddress()
235+
+ ":" + IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_HOSTPORT;
236+
} catch (UnknownHostException ex) {
237+
logger.severe(ex.getLocalizedMessage());
238+
}
239+
}
226240

227241
if (OKE_CLUSTER_PRIVATEIP) {
228242
String localhost = "localhost";
@@ -233,7 +247,6 @@ private void deployPrometheusAndVerify(String domainNamespace, String domainUid,
233247
logger.info("Forwarded local port is {0}", forwardPort);
234248
hostPortPrometheus = localhost + ":" + forwardPort;
235249
isPrometheusPortForward = true;
236-
237250
}
238251
} else {
239252
String newRegex = String.format("regex: %s;%s", domainNamespace, domainUid);
@@ -394,7 +407,17 @@ private void setupIstioModelInImageDomain(String miiImage, String domainNamespac
394407
// In internal OKE env, use Istio EXTERNAL-IP; in non-OKE env, use K8S_NODEPORT_HOST + ":" + istioIngressPort
395408
String hostAndPort = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
396409
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) : host + ":" + istioIngressPort;
397-
410+
String deployHost = K8S_NODEPORT_HOST;
411+
412+
if (!TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT) && !OCNE) {
413+
istioIngressPort = ISTIO_HTTP_HOSTPORT;
414+
try {
415+
hostAndPort = InetAddress.getLocalHost().getHostAddress() + ":" + istioIngressPort;
416+
deployHost = InetAddress.getLocalHost().getHostAddress();
417+
} catch (UnknownHostException ex) {
418+
logger.severe(ex.getLocalizedMessage());
419+
}
420+
}
398421
String readyAppUrl = "http://" + hostAndPort + "/weblogic/ready";
399422
boolean checlReadyApp =
400423
checkAppUsingHostHeader(readyAppUrl, domainNamespace + ".org");
@@ -406,7 +429,7 @@ private void setupIstioModelInImageDomain(String miiImage, String domainNamespac
406429
ExecResult result = OKE_CLUSTER
407430
? deployUsingRest(hostAndPort, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT,
408431
target, archivePath, domainNamespace + ".org", "testwebapp")
409-
: deployToClusterUsingRest(K8S_NODEPORT_HOST,
432+
: deployToClusterUsingRest(deployHost,
410433
String.valueOf(istioIngressPort),
411434
ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT,
412435
clusterName, archivePath, domainNamespace + ".org", "testwebapp");

0 commit comments

Comments
 (0)