Skip to content

Commit 16e85de

Browse files
anpanigrANTARYAMI.PANIGRAHI@ORACLE.COMANTARYAMI.PANIGRAHI@ORACLE.COM
authored
External RMI Tunneling with Traefik (#2384)
* External RMI Tunneling with Traefik Co-authored-by: [email protected] <[email protected]> Co-authored-by: [email protected] <[email protected]>
1 parent 7964777 commit 16e85de

File tree

7 files changed

+499
-139
lines changed

7 files changed

+499
-139
lines changed

integration-tests/src/test/java/oracle/weblogic/domain/ClusterService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ public void setAnnotations(Map<String, String> annotations) {
8989
this.annotations = annotations;
9090
}
9191

92+
public ClusterService sessionAffinity(String sessionAffinity) {
93+
this.sessionAffinity = sessionAffinity;
94+
return this;
95+
}
96+
9297
public String getSessionAffinity() {
9398
return sessionAffinity;
9499
}

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

Lines changed: 361 additions & 139 deletions
Large diffs are not rendered by default.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ public interface TestConstants {
143143

144144
public static final String K8S_NODEPORT_HOST = Optional.ofNullable(System.getenv("K8S_NODEPORT_HOST"))
145145
.orElse(assertDoesNotThrow(() -> InetAddress.getLocalHost().getHostAddress()));
146+
public static final String K8S_NODEPORT_HOSTNAME = Optional.ofNullable(System.getenv("K8S_NODEPORT_HOSTNAME"))
147+
.orElse(assertDoesNotThrow(() -> InetAddress.getLocalHost().getHostName()));
146148
public static final String RESULTS_BASE = System.getenv().getOrDefault("RESULT_ROOT",
147149
System.getProperty("java.io.tmpdir") + "/it-testsresults");
148150

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright (c) 2021, Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
# https://kubernetes.github.io/ingress-nginx/examples/
4+
5+
apiVersion: extensions/v1beta1
6+
kind: Ingress
7+
metadata:
8+
name: ngnix-tls-tunneling
9+
namespace: DOMAIN_NS
10+
annotations:
11+
kubernetes.io/ingress.class: nginx
12+
nginx.ingress.kubernetes.io/affinity: "cookie"
13+
nginx.ingress.kubernetes.io/session-cookie-name: "JSESSIONID"
14+
nginx.ingress.kubernetes.io/configuration-snippet: |
15+
more_clear_input_headers "WL-Proxy-Client-IP" "WL-Proxy-SSL";
16+
more_set_input_headers "X-Forwarded-Proto: https";
17+
more_set_input_headers "WL-Proxy-SSL: true";
18+
nginx.ingress.kubernetes.io/ingress.allow-http: "false"
19+
spec:
20+
tls:
21+
- hosts:
22+
- 'INGRESS_HOST'
23+
secretName: TLS_CERT
24+
rules:
25+
- host: 'INGRESS_HOST'
26+
http:
27+
paths:
28+
- path:
29+
backend:
30+
serviceName: DOMAIN_UID-cluster-CLUSTER
31+
servicePort: 8877
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2021, Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
# https://kubernetes.github.io/ingress-nginx/examples/
4+
5+
apiVersion: extensions/v1beta1
6+
kind: Ingress
7+
metadata:
8+
annotations:
9+
kubernetes.io/ingress.class: nginx
10+
nginx.ingress.kubernetes.io/affinity: cookie
11+
nginx.ingress.kubernetes.io/session-cookie-name: "JSESSIONID"
12+
labels:
13+
name: ngnix-tunneling
14+
namespace: DOMAIN_NS
15+
spec:
16+
rules:
17+
- host:
18+
http:
19+
paths:
20+
- backend:
21+
serviceName: DOMAIN_UID-cluster-CLUSTER
22+
servicePort: 7788
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright (c) 2021, Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
apiVersion: traefik.containo.us/v1alpha1
5+
kind: IngressRoute
6+
metadata:
7+
annotations:
8+
kubernetes.io/ingress.class: traefik
9+
name: traefik-tls-tunneling
10+
namespace: DOMAIN_NS
11+
spec:
12+
entryPoints:
13+
- websecure
14+
routes:
15+
- kind: Rule
16+
match: Host(`INGRESS_HOST`)
17+
middlewares:
18+
- name: tls-middleware
19+
namespace: DOMAIN_NS
20+
services:
21+
- kind: Service
22+
name: DOMAIN_UID-cluster-CLUSTER
23+
namespace: DOMAIN_NS
24+
port: 8877
25+
sticky:
26+
cookie:
27+
httpOnly: true
28+
tls: {}
29+
30+
---
31+
apiVersion: traefik.containo.us/v1alpha1
32+
kind: Middleware
33+
metadata:
34+
name: tls-middleware
35+
namespace: DOMAIN_NS
36+
spec:
37+
headers:
38+
customRequestHeaders:
39+
X-Custom-Request-Header: "" # Removes
40+
X-Forwarded-For: "" # Removes
41+
WL-Proxy-Client-IP: "" # Removes
42+
WL-Proxy-SSL: "" # Removes
43+
WL-Proxy-SSL: "true" # Adds
44+
sslRedirect: true
45+
46+
---
47+
apiVersion: traefik.containo.us/v1alpha1
48+
kind: TLSStore
49+
metadata:
50+
name: default
51+
namespace: DOMAIN_NS
52+
spec:
53+
defaultCertificate:
54+
secretName: TLS_CERT
55+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2021, Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
apiVersion: traefik.containo.us/v1alpha1
5+
kind: IngressRoute
6+
metadata:
7+
annotations:
8+
kubernetes.io/ingress.class: traefik
9+
name: traefik-tunneling
10+
namespace: DOMAIN_NS
11+
spec:
12+
entryPoints: []
13+
routes:
14+
- kind: Rule
15+
match: Host(`INGRESS_HOST`)
16+
services:
17+
- kind: Service
18+
name: DOMAIN_UID-cluster-CLUSTER
19+
namespace: DOMAIN_NS
20+
port: 7788
21+
sticky:
22+
cookie:
23+
httpOnly: true

0 commit comments

Comments
 (0)