Skip to content

Commit 547b139

Browse files
sankarpnjshum2479
authored andcommitted
Fix for podman nightly failures
1 parent 92f5043 commit 547b139

File tree

7 files changed

+142
-43
lines changed

7 files changed

+142
-43
lines changed

Jenkinsfile.podman

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ pipeline {
375375
if kind delete cluster --name ${kind_name} --kubeconfig "${kubeconfig_file}"; then
376376
echo "Deleted orphaned kind cluster ${kind_name}"
377377
fi
378+
# settings needed by elastic logging tests
379+
echo "running sudo sysctl -w vm.max_map_count=262144"
380+
sudo sysctl -w vm.max_map_count=262144
378381
cat <<EOF | kind create cluster --name "${kind_name}" --kubeconfig "${kubeconfig_file}" --config=-
379382
kind: Cluster
380383
apiVersion: kind.x-k8s.io/v1alpha4
@@ -420,7 +423,7 @@ nodes:
420423
protocol: TCP
421424
- containerPort: 32170
422425
hostPort: 2173
423-
protocol: TCP
426+
protocol: TCP
424427
- containerPort: 32189
425428
hostPort: 2182
426429
protocol: TCP
@@ -432,7 +435,22 @@ nodes:
432435
protocol: TCP
433436
- containerPort: 32343
434437
hostPort: 2343
435-
protocol: TCP
438+
protocol: TCP
439+
- containerPort: 32331
440+
hostPort: 2331
441+
protocol: TCP
442+
- containerPort: 31781
443+
hostPort: 2781
444+
protocol: TCP
445+
- containerPort: 31744
446+
hostPort: 2782
447+
protocol: TCP
448+
- containerPort: 31785
449+
hostPort: 2785
450+
protocol: TCP
451+
- containerPort: 31746
452+
hostPort: 2786
453+
protocol: TCP
436454
extraMounts:
437455
- hostPath: ${pv_root}
438456
containerPath: ${pv_root}
@@ -447,6 +465,7 @@ EOF
447465
for node in $(kind get nodes --name "${kind_name}"); do
448466
kubectl annotate node ${node} tilt.dev/registry=localhost:${registry_port};
449467
done
468+
podman exec -it kind-worker bash -c "sysctl vm.max_map_count"
450469

451470
# Document the local registry
452471
# https://github.com/kubernetes/enhancements/tree/master/keps/sig-cluster-lifecycle/generic/1755-communicating-a-local-registry

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 & 2 deletions
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,15 +222,23 @@ public static void initAll(@Namespaces(4) List<String> namespaces) {
212222
);
213223

214224
// install and verify NGINX
215-
nginxHelmParams = installAndVerifyNginx(nginxNamespace, 0, 0);
216-
225+
nginxHelmParams = installAndVerifyNginx(nginxNamespace, ITHPACUSTOMNGINX_INGRESS_HTTP_NODEPORT,
226+
ITHPACUSTOMNGINX_INGRESS_HTTPS_NODEPORT, NGINX_CHART_VERSION, (OKE_CLUSTER ? null : "NodePort"));
217227
String nginxServiceName = nginxHelmParams.getHelmParams().getReleaseName() + "-ingress-nginx-controller";
218228
logger.info("NGINX service name: {0}", nginxServiceName);
219229
nodeportshttp = getServiceNodePort(nginxNamespace, nginxServiceName, "http");
220230
logger.info("NGINX http node port: {0}", nodeportshttp);
221231
String host = formatIPv6Host(K8S_NODEPORT_HOST);
222232
ingressIP = getServiceExtIPAddrtOke(nginxServiceName, nginxNamespace) != null
223233
? getServiceExtIPAddrtOke(nginxServiceName, nginxNamespace) : host;
234+
if (KIND_CLUSTER && !WLSIMG_BUILDER.equals(WLSIMG_BUILDER_DEFAULT)) {
235+
try {
236+
ingressIP = formatIPv6Host(InetAddress.getLocalHost().getHostAddress());
237+
} catch (UnknownHostException ex) {
238+
logger.severe(ex.getLocalizedMessage());
239+
}
240+
nodeportshttp = ITHPACUSTOMNGINX_INGRESS_HTTP_HOSTPORT;
241+
}
224242

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

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

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

44
package oracle.weblogic.kubernetes;
55

6+
import java.net.InetAddress;
7+
import java.net.UnknownHostException;
68
import java.nio.file.Path;
79
import java.nio.file.Paths;
810
import java.util.ArrayList;
@@ -24,7 +26,11 @@
2426

2527
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_PASSWORD_DEFAULT;
2628
import static oracle.weblogic.kubernetes.TestConstants.ADMIN_USERNAME_DEFAULT;
29+
import static oracle.weblogic.kubernetes.TestConstants.ISTIO_HTTP_HOSTPORT;
30+
import static oracle.weblogic.kubernetes.TestConstants.IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_CONAINERPORT;
31+
import static oracle.weblogic.kubernetes.TestConstants.IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_HOSTPORT;
2732
import static oracle.weblogic.kubernetes.TestConstants.K8S_NODEPORT_HOST;
33+
import static oracle.weblogic.kubernetes.TestConstants.OCNE;
2834
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER;
2935
import static oracle.weblogic.kubernetes.TestConstants.OKE_CLUSTER_PRIVATEIP;
3036
import static oracle.weblogic.kubernetes.TestConstants.RESULTS_ROOT;
@@ -38,7 +44,6 @@
3844
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.createTestWebAppWarFile;
3945
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.formatIPv6Host;
4046
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getImageBuilderExtraArgs;
41-
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getNextFreePort;
4247
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.getServiceExtIPAddrtOke;
4348
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.startPortForwardProcess;
4449
import static oracle.weblogic.kubernetes.utils.CommonTestUtils.stopPortForwardProcess;
@@ -140,7 +145,7 @@ public static void initAll(@Namespaces(3) List<String> namespaces) {
140145

141146
// install and verify operator
142147
installAndVerifyOperator(opNamespace, domain1Namespace, domain2Namespace);
143-
prometheusPort = getNextFreePort();
148+
prometheusPort = IT_ISTIOMONITORINGEXPORTER_PROM_HTTP_CONAINERPORT;
144149
}
145150

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

227240
if (OKE_CLUSTER_PRIVATEIP) {
228241
String localhost = "localhost";
@@ -233,7 +246,6 @@ private void deployPrometheusAndVerify(String domainNamespace, String domainUid,
233246
logger.info("Forwarded local port is {0}", forwardPort);
234247
hostPortPrometheus = localhost + ":" + forwardPort;
235248
isPrometheusPortForward = true;
236-
237249
}
238250
} else {
239251
String newRegex = String.format("regex: %s;%s", domainNamespace, domainUid);
@@ -394,7 +406,17 @@ private void setupIstioModelInImageDomain(String miiImage, String domainNamespac
394406
// In internal OKE env, use Istio EXTERNAL-IP; in non-OKE env, use K8S_NODEPORT_HOST + ":" + istioIngressPort
395407
String hostAndPort = getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) != null
396408
? getServiceExtIPAddrtOke(istioIngressServiceName, istioNamespace) : host + ":" + istioIngressPort;
397-
409+
410+
String deployHost = K8S_NODEPORT_HOST;
411+
if (!TestConstants.WLSIMG_BUILDER.equals(TestConstants.WLSIMG_BUILDER_DEFAULT) && !OCNE) {
412+
istioIngressPort = ISTIO_HTTP_HOSTPORT;
413+
try {
414+
hostAndPort = InetAddress.getLocalHost().getHostAddress() + ":" + istioIngressPort;
415+
deployHost = InetAddress.getLocalHost().getHostAddress();
416+
} catch (UnknownHostException ex) {
417+
logger.severe(ex.getLocalizedMessage());
418+
}
419+
}
398420
String readyAppUrl = "http://" + hostAndPort + "/weblogic/ready";
399421
boolean checlReadyApp =
400422
checkAppUsingHostHeader(readyAppUrl, domainNamespace + ".org");
@@ -406,7 +428,7 @@ private void setupIstioModelInImageDomain(String miiImage, String domainNamespac
406428
ExecResult result = OKE_CLUSTER
407429
? deployUsingRest(hostAndPort, ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT,
408430
target, archivePath, domainNamespace + ".org", "testwebapp")
409-
: deployToClusterUsingRest(K8S_NODEPORT_HOST,
431+
: deployToClusterUsingRest(deployHost,
410432
String.valueOf(istioIngressPort),
411433
ADMIN_USERNAME_DEFAULT, ADMIN_PASSWORD_DEFAULT,
412434
clusterName, archivePath, domainNamespace + ".org", "testwebapp");

0 commit comments

Comments
 (0)