From 948d63c32a98ab431eddc7dd542edae2425b4341 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Sun, 16 Mar 2025 12:35:08 +0000 Subject: [PATCH] OFC25 tests: - Updated E2E topology descriptor - Updated NGINX ingress controllers to support sticky sessions for SocketIO towards NBI --- src/tests/ofc25/descriptors/topology_e2e.json | 48 +++++++++---------- src/tests/ofc25/tfs-ingress-e2e.yaml | 30 +++++++++++- src/tests/ofc25/tfs-ingress-ip.yaml | 30 +++++++++++- src/tests/ofc25/tfs-ingress-opt.yaml | 30 +++++++++++- 4 files changed, 111 insertions(+), 27 deletions(-) diff --git a/src/tests/ofc25/descriptors/topology_e2e.json b/src/tests/ofc25/descriptors/topology_e2e.json index 8c3c1fd40..16a4ead24 100644 --- a/src/tests/ofc25/descriptors/topology_e2e.json +++ b/src/tests/ofc25/descriptors/topology_e2e.json @@ -30,56 +30,56 @@ } ], "links": [ - {"link_id": {"link_uuid": {"uuid": "CSGW1-TP1.1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "CSGW1"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}}, + {"link_id": {"link_uuid": {"uuid": "IP1-TP1.1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}}, {"device_id": {"device_uuid": {"uuid": "TP1.1"}}, "endpoint_uuid": {"uuid": "CLIENT" }} ]}, - {"link_id": {"link_uuid": {"uuid": "CSGW1-TP1.2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "CSGW1"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}}, + {"link_id": {"link_uuid": {"uuid": "IP1-TP1.2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}}, {"device_id": {"device_uuid": {"uuid": "TP1.2"}}, "endpoint_uuid": {"uuid": "CLIENT" }} ]}, - {"link_id": {"link_uuid": {"uuid": "CSGW1-TP1.3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "CSGW1"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}}, + {"link_id": {"link_uuid": {"uuid": "IP1-TP1.3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}}, {"device_id": {"device_uuid": {"uuid": "TP1.3"}}, "endpoint_uuid": {"uuid": "CLIENT" }} ]}, - {"link_id": {"link_uuid": {"uuid": "CSGW2-TP2.1"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "CSGW2"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}}, + {"link_id": {"link_uuid": {"uuid": "IP2-TP2.1"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}}, {"device_id": {"device_uuid": {"uuid": "TP2.1"}}, "endpoint_uuid": {"uuid": "CLIENT" }} ]}, - {"link_id": {"link_uuid": {"uuid": "CSGW2-TP2.2"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "CSGW2"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}}, + {"link_id": {"link_uuid": {"uuid": "IP2-TP2.2"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}}, {"device_id": {"device_uuid": {"uuid": "TP2.2"}}, "endpoint_uuid": {"uuid": "CLIENT" }} ]}, - {"link_id": {"link_uuid": {"uuid": "CSGW2-TP2.3"}}, "link_endpoint_ids": [ - {"device_id": {"device_uuid": {"uuid": "CSGW2"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}}, + {"link_id": {"link_uuid": {"uuid": "IP2-TP2.3"}}, "link_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}}, {"device_id": {"device_uuid": {"uuid": "TP2.3"}}, "endpoint_uuid": {"uuid": "CLIENT" }} ]}, - {"link_id": {"link_uuid": {"uuid": "TP1.1-CSGW1"}}, "link_endpoint_ids": [ + {"link_id": {"link_uuid": {"uuid": "TP1.1-IP1"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "TP1.1"}}, "endpoint_uuid": {"uuid": "CLIENT" }}, - {"device_id": {"device_uuid": {"uuid": "CSGW1"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}} + {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}} ]}, - {"link_id": {"link_uuid": {"uuid": "TP1.2-CSGW1"}}, "link_endpoint_ids": [ + {"link_id": {"link_uuid": {"uuid": "TP1.2-IP1"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "TP1.2"}}, "endpoint_uuid": {"uuid": "CLIENT" }}, - {"device_id": {"device_uuid": {"uuid": "CSGW1"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}} + {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}} ]}, - {"link_id": {"link_uuid": {"uuid": "TP1.3-CSGW1"}}, "link_endpoint_ids": [ + {"link_id": {"link_uuid": {"uuid": "TP1.3-IP1"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "TP1.3"}}, "endpoint_uuid": {"uuid": "CLIENT" }}, - {"device_id": {"device_uuid": {"uuid": "CSGW1"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}} + {"device_id": {"device_uuid": {"uuid": "IP1"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}} ]}, - {"link_id": {"link_uuid": {"uuid": "TP2.1-CSGW2"}}, "link_endpoint_ids": [ + {"link_id": {"link_uuid": {"uuid": "TP2.1-IP2"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "TP2.1"}}, "endpoint_uuid": {"uuid": "CLIENT" }}, - {"device_id": {"device_uuid": {"uuid": "CSGW2"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}} + {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "PORT-xe1"}} ]}, - {"link_id": {"link_uuid": {"uuid": "TP2.2-CSGW2"}}, "link_endpoint_ids": [ + {"link_id": {"link_uuid": {"uuid": "TP2.2-IP2"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "TP2.2"}}, "endpoint_uuid": {"uuid": "CLIENT" }}, - {"device_id": {"device_uuid": {"uuid": "CSGW2"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}} + {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "PORT-xe2"}} ]}, - {"link_id": {"link_uuid": {"uuid": "TP2.3-CSGW2"}}, "link_endpoint_ids": [ + {"link_id": {"link_uuid": {"uuid": "TP2.3-IP2"}}, "link_endpoint_ids": [ {"device_id": {"device_uuid": {"uuid": "TP2.3"}}, "endpoint_uuid": {"uuid": "CLIENT" }}, - {"device_id": {"device_uuid": {"uuid": "CSGW2"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}} + {"device_id": {"device_uuid": {"uuid": "IP2"}}, "endpoint_uuid": {"uuid": "PORT-xe3"}} ]} ] } diff --git a/src/tests/ofc25/tfs-ingress-e2e.yaml b/src/tests/ofc25/tfs-ingress-e2e.yaml index c75a22cb3..c2f4a5a60 100644 --- a/src/tests/ofc25/tfs-ingress-e2e.yaml +++ b/src/tests/ofc25/tfs-ingress-e2e.yaml @@ -17,7 +17,28 @@ kind: Ingress metadata: name: tfs-ingress-e2e annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/rewrite-target: "/$2" + + # Enable websocket services and configure sticky cookies (seems not to work) + #nginx.org/websocket-services: "nbiservice" + #nginx.org/sticky-cookie-services: "serviceName=nbiservice tfs-nbi-session expires=1h path=/socket.io" + + # Enable sticky sessions (use same backend for all connections + # originated by a specific client, identified through its cookie) + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/session-cookie-name: "tfs-nbi-session" + nginx.ingress.kubernetes.io/session-cookie-path: "/socket.io" + nginx.ingress.kubernetes.io/session-cookie-expires: "3600" + nginx.ingress.kubernetes.io/session-cookie-change-on-failure: "true" + + nginx.ingress.kubernetes.io/limit-rps: "50" # max requests per second per source IP + nginx.ingress.kubernetes.io/limit-connections: "50" # max concurrent connections per source IP + nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" # max timeout for connecting to server + + # Enable long-lived connections, required for websocket/socket.io streams + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # max timeout between two successive read operations + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" # max timeout between two successive write operations spec: ingressClassName: tfs-ingress-class-e2e rules: @@ -44,6 +65,13 @@ spec: name: nbiservice port: number: 8080 + - path: /()(socket.io/.*) + pathType: Prefix + backend: + service: + name: nbiservice + port: + number: 8080 - path: /()(tfs-api/.*) pathType: Prefix backend: diff --git a/src/tests/ofc25/tfs-ingress-ip.yaml b/src/tests/ofc25/tfs-ingress-ip.yaml index aefcfcffe..43bc52b4a 100644 --- a/src/tests/ofc25/tfs-ingress-ip.yaml +++ b/src/tests/ofc25/tfs-ingress-ip.yaml @@ -17,7 +17,28 @@ kind: Ingress metadata: name: tfs-ingress-ip annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/rewrite-target: "/$2" + + # Enable websocket services and configure sticky cookies (seems not to work) + #nginx.org/websocket-services: "nbiservice" + #nginx.org/sticky-cookie-services: "serviceName=nbiservice tfs-nbi-session expires=1h path=/socket.io" + + # Enable sticky sessions (use same backend for all connections + # originated by a specific client, identified through its cookie) + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/session-cookie-name: "tfs-nbi-session" + nginx.ingress.kubernetes.io/session-cookie-path: "/socket.io" + nginx.ingress.kubernetes.io/session-cookie-expires: "3600" + nginx.ingress.kubernetes.io/session-cookie-change-on-failure: "true" + + nginx.ingress.kubernetes.io/limit-rps: "50" # max requests per second per source IP + nginx.ingress.kubernetes.io/limit-connections: "50" # max concurrent connections per source IP + nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" # max timeout for connecting to server + + # Enable long-lived connections, required for websocket/socket.io streams + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # max timeout between two successive read operations + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" # max timeout between two successive write operations spec: ingressClassName: tfs-ingress-class-ip rules: @@ -44,6 +65,13 @@ spec: name: nbiservice port: number: 8080 + - path: /()(socket.io/.*) + pathType: Prefix + backend: + service: + name: nbiservice + port: + number: 8080 - path: /()(tfs-api/.*) pathType: Prefix backend: diff --git a/src/tests/ofc25/tfs-ingress-opt.yaml b/src/tests/ofc25/tfs-ingress-opt.yaml index 57e1f9141..87fc29de5 100644 --- a/src/tests/ofc25/tfs-ingress-opt.yaml +++ b/src/tests/ofc25/tfs-ingress-opt.yaml @@ -17,7 +17,28 @@ kind: Ingress metadata: name: tfs-ingress-opt annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/rewrite-target: "/$2" + + # Enable websocket services and configure sticky cookies (seems not to work) + #nginx.org/websocket-services: "nbiservice" + #nginx.org/sticky-cookie-services: "serviceName=nbiservice tfs-nbi-session expires=1h path=/socket.io" + + # Enable sticky sessions (use same backend for all connections + # originated by a specific client, identified through its cookie) + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/session-cookie-name: "tfs-nbi-session" + nginx.ingress.kubernetes.io/session-cookie-path: "/socket.io" + nginx.ingress.kubernetes.io/session-cookie-expires: "3600" + nginx.ingress.kubernetes.io/session-cookie-change-on-failure: "true" + + nginx.ingress.kubernetes.io/limit-rps: "50" # max requests per second per source IP + nginx.ingress.kubernetes.io/limit-connections: "50" # max concurrent connections per source IP + nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" # max timeout for connecting to server + + # Enable long-lived connections, required for websocket/socket.io streams + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # max timeout between two successive read operations + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" # max timeout between two successive write operations spec: ingressClassName: tfs-ingress-class-opt rules: @@ -44,6 +65,13 @@ spec: name: nbiservice port: number: 8080 + - path: /()(socket.io/.*) + pathType: Prefix + backend: + service: + name: nbiservice + port: + number: 8080 - path: /()(tfs-api/.*) pathType: Prefix backend: -- GitLab