Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions tests/e2e/scenarios/service-scale/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Service Scale Test

This scenario stress-tests Skupper by creating a large number of services via Listener/Connector pairs across two sites. It focuses on scale along these dimensions:

- Number of Listeners (west)
- Number of Connectors (east)

It provisions two sites (`west` and `east`), deploys a single backend app on the `east` site, and then creates N service pairs that route to the same backend (distinguished by routing keys and unique listener ports). A smoke test verifies functionality on one service; readiness checks validate the full set.

## Structure

```
service-scale/
├── inventory/
│ ├── hosts.yml
│ ├── group_vars/
│ │ └── all.yml
│ └── host_vars/
│ ├── west.yml
│ └── east.yml
├── resources/
│ ├── west/
│ │ └── site.yml
│ └── east/
│ ├── site.yml
│ └── backend.yml
└── test.yml
```

## Parameters (defaults in `inventory/group_vars/all.yml`)

- `service_count`: number of Listener/Connector pairs
- `service_name_prefix` (default: `svc`): service/CR name prefix
- `routing_key_prefix` (default: `svc`): routing key prefix
- `base_listener_port` (default: 10080): port base for west Listeners (`base + i`)
- `backend_app_label` (default: `backend`): label selector for backend pods
- `backend_port` (default: 8080): backend container port
- `smoke_test_index` (default: 1): which service to curl
- `ready_retries`/`ready_delay`: readiness polling

To override, update `inventory/group_vars/all.yml` or pass `-e var=value`.

## Acceptance Criteria

- Functional:
- All `service_count` Connectors and Listeners reach status “Ready”.
- Smoke request from `west` to `svc-<smoke_test_index>` returns success (via `e2e.tests.run_curl`).
- Non-functional:
- All resources become Ready within the allotted retries/delay window (configurable via `ready_retries` and `ready_delay`).

## Prerequisites

- Skupper v2 controller installed cluster-wide
- Two accessible Kubernetes contexts (west/east) or a single cluster with both namespaces
- `kubeconfig` paths set in `inventory/host_vars/west.yml` and `inventory/host_vars/east.yml`

## Run

From `skupper/tests`:

```bash
make create-venv FORCE=true
make test TEST="service-scale"
```

Override scale:

```bash
make test TEST="service-scale" EXTRA_VARS="-e service_count=500 -e ready_retries=900 -e ready_delay=2"
```

Skip teardown:

```bash
make test TEST="service-scale" EXTRA_VARS="-e skip_teardown=true"
```

## Notes

- All services route to the same backend Deployment on `east`. This validates control-plane scale without multiplying app pods.
- Each Listener uses a unique port (`base_listener_port + i`) and unique `routingKey` (`svc-i`).

27 changes: 27 additions & 0 deletions tests/e2e/scenarios/service-scale/inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
ansible_connection: local
ansible_user: "{{ lookup('env', 'USER') }}"
debug: false
namespace_prefix: "e2e"
generate_namespaces_namespace_label: "service-scale"

service_count: 50
service_name_prefix: "svc"
routing_key_prefix: "svc"

base_listener_port: 10080

backend_app_label: "backend"
backend_port: 8080

smoke_test_index: 1

ready_retries: 0
ready_delay: 5

validate_all: false
validation_sample_size: 1

use_dynamic_creation: true

skip_teardown: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Kubeconfig path for east site
kubeconfig_2: "{{ ansible_env.HOME }}/.kube/config"
kubeconfig: "{{ kubeconfig_2 }}"

# Namespace configuration
namespace_name: service-scale-east

14 changes: 14 additions & 0 deletions tests/e2e/scenarios/service-scale/inventory/host_vars/west.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
# Kubeconfig path for west site
kubeconfig_1: "{{ ansible_env.HOME }}/.kube/config"
kubeconfig: "{{ kubeconfig_1 }}"

# Namespace configuration
namespace_name: service-scale-west

# Run curl configuration
run_curl_namespace: default
run_curl_image: "{{ skupper_test_images_lanyard }}"
run_curl_pod_name: curl-test
run_curl_retries: 30
run_curl_delay: 6
6 changes: 6 additions & 0 deletions tests/e2e/scenarios/service-scale/inventory/hosts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
all:
hosts:
west:
east:

23 changes: 23 additions & 0 deletions tests/e2e/scenarios/service-scale/resources/east/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
labels:
app: backend
spec:
selector:
matchLabels:
app: backend
replicas: 3
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: quay.io/skupper/hello-world-backend
ports:
- containerPort: 8080

7 changes: 7 additions & 0 deletions tests/e2e/scenarios/service-scale/resources/east/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: east
spec:
linkAccess: default
8 changes: 8 additions & 0 deletions tests/e2e/scenarios/service-scale/resources/west/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: skupper.io/v2alpha1
kind: Site
metadata:
name: west
spec:
linkAccess: default

20 changes: 20 additions & 0 deletions tests/e2e/scenarios/service-scale/skupper-sites.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Apply full resources directory (static mode)
skupper.v2.resource:
path: "{{ playbook_dir }}/resources/{{ site_name }}/"
namespace: "{{ namespace_prefix }}-{{ namespace_name }}"
kubeconfig: "{{ kubeconfig }}"
when:
- not (use_dynamic_creation | default(false) | bool)

- name: Apply site (and backend on east) only (dynamic mode)
skupper.v2.resource:
path: "{{ item }}"
namespace: "{{ namespace_prefix }}-{{ namespace_name }}"
kubeconfig: "{{ kubeconfig }}"
with_items:
- "{{ playbook_dir }}/resources/{{ site_name }}/site.yml"
- "{{ (playbook_dir ~ '/resources/' ~ site_name ~ '/backend.yml') if (site_name == 'east') else omit }}"
when:
- use_dynamic_creation | default(false) | bool

Loading