Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
5d38f72
Add stress and scalability test framework for EFS CSI Driver
ishaanbhardwaj2003 Jun 5, 2025
2a86c48
Add stress and scalability test framework for EFS CSI Driver
ishaanbhardwaj2003 Jun 5, 2025
a5cc6e9
Update configuration and run script for stress testing framework
ishaanbhardwaj2003 Jun 9, 2025
fb33254
Move stress-scale-tests from test/e2e/ to test/ directory and improve…
ishaanbhardwaj2003 Jun 9, 2025
b4a46e5
Improve operation interval handling and add detailed failure logging
ishaanbhardwaj2003 Jun 11, 2025
6c26919
Refactor testing framework: Modularize code for better maintainability
ishaanbhardwaj2003 Jun 17, 2025
a0d8ddd
Merge branch 'kubernetes-sigs:master' into master
ishaanbhardwaj2003 Jun 17, 2025
b725856
Add modularized testing framework with enhanced documentation
ishaanbhardwaj2003 Jun 17, 2025
c503170
Remove logs and report files from repository
ishaanbhardwaj2003 Jun 17, 2025
0d42a02
Add .gitignore to exclude logs, reports, and other unnecessary files
ishaanbhardwaj2003 Jun 17, 2025
6f147a2
Remove Python cache files from repository
ishaanbhardwaj2003 Jun 17, 2025
a2e87b5
Add comprehensive documentation to orchestrator_config.yaml
ishaanbhardwaj2003 Jun 17, 2025
a92bcf1
Add controller crash resilience test to validate CSI driver behavior …
ishaanbhardwaj2003 Jun 17, 2025
47e1a71
Refactor config into modular component files and add boto3 dependency
ishaanbhardwaj2003 Jun 24, 2025
0a9cee1
Merge branch 'kubernetes-sigs:master' into updated-tests
ishaanbhardwaj2003 Jun 24, 2025
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
25 changes: 25 additions & 0 deletions test/stress-scale-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs/
*.log

# Reports
reports/
test-reports/

# Result files
results/
results.tgz

# Python cache files
__pycache__/
*.py[cod]
*.class

# Helper scripts that shouldn't be committed
count_method_lines.py
count_method_lines_by_category.py
method_stats.txt

# Other files
monitoring/
efs-permissions-policy.json
179 changes: 179 additions & 0 deletions test/stress-scale-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# AWS EFS CSI Driver Stress and Scalability Tests

This framework provides comprehensive stress and scalability testing for the AWS EFS CSI Driver in Kubernetes environments.

## Overview

The test framework automatically generates load on the EFS CSI Driver by creating and managing PVCs and Pods according to configurable parameters. It tests various access patterns and scenarios to ensure reliability under stress.

## Features

- **Orchestrated Testing**: Random sequence of volume and pod operations with configurable weights
- **Scenario Testing**: Specialized test scenarios including:
- Shared Volume Access (multiple pods using a single PVC to test ReadWriteMany capability)
- Dedicated Volume Access (individual pods with dedicated PVCs to test isolation)
- Concurrent Volume Operations (rapid creation and deletion of multiple PVCs to test API handling)
- **Shared Volume Testing**: Verifies read/write operations between pods sharing volumes
- **Comprehensive Reporting**: Detailed logs and metrics in JSON and summary formats
- **Configurable Parameters**: Adjust test duration, operation rates, resource limits, and more

## Prerequisites

- AWS Account with appropriate permissions for:
- EFS filesystem creation and management
- EKS cluster management (if creating a new cluster)
- Kubernetes cluster with:
- EFS CSI Driver installed (unless using the orchestrator to install it)
- Node(s) in the same VPC as your EFS filesystem
- `kubectl` configured to access the cluster
- Required Python packages (install via requirements.txt):
- kubernetes
- pytest
- pyyaml
- prometheus_client
- pandas
- psutil
- boto3

## Quick Start

### Important Configuration Notes

Before running tests, you'll need to configure key settings in `config/orchestrator_config.yaml`. The most important sections are:

1. **Driver Configuration**:
```yaml
driver:
create_filesystem: true/false # Set to true to automatically create a new EFS filesystem
filesystem_id: fs-xxx # Required if create_filesystem is false (use existing filesystem)
# Note: If create_filesystem is true, boto3 will be used to create the filesystem
```

2. **Storage Class Configuration**:
```yaml
storage_class:
parameters:
fileSystemId: fs-xxx # Must match your filesystem_id
region: us-west-1 # Your AWS region
availabilityZoneName: us-west-1b # AZ where your nodes are running
```

3. **Pod Configuration**:
```yaml
pod_config:
node_selector:
topology.kubernetes.io/zone: us-west-1b # Must match your node's AZ
```

### Getting Started

1. Set up a Python virtual environment (recommended):
```
# Create a virtual environment
python -m venv venv

# Activate the virtual environment
# On Linux/macOS:
source venv/bin/activate
# On Windows:
# venv\Scripts\activate
```

2. Install dependencies:
```
pip install -r requirements.txt
```

3. Configure the test parameters in `config/orchestrator_config.yaml`

4. Run the tests:
```
python run_tests.py
```

## Configuration Structure

The configuration is modularized into separate components for better organization and clarity:

1. `config/orchestrator_config.yaml`: Main configuration file that imports component configurations
2. Component configurations in `config/components/`:
- `driver.yaml`: Driver installation and resource settings
- `storage.yaml`: Storage class configuration
- `test.yaml`: Test parameters, metrics, and reporting settings
- `pod.yaml`: Pod configuration settings
- `scenarios.yaml`: Test scenario definitions

Each component file is well-documented with comments explaining available options. The modular structure allows you to:
- Focus on specific configuration aspects independently
- Easily understand which settings are related
- Comment out unused sections without affecting other components
- Override specific settings in the main config file if needed

### Key Configuration Parameters

Most commonly adjusted settings:

1. In `driver.yaml`:
- `driver.create_filesystem`: Whether to create a new EFS filesystem
- `driver.filesystem_id`: Your EFS filesystem ID

2. In `storage.yaml`:
- `storage_class.parameters.fileSystemId`: Must match your filesystem_id
- `storage_class.parameters.region`: Your AWS region
- `storage_class.parameters.availabilityZoneName`: Your AZ

3. In `test.yaml`:
- `test.duration`: Test duration in seconds
- `test.namespace`: Kubernetes namespace for test resources
- `test.operation_interval`: Time between operations

4. In `pod.yaml`:
- `pod_config.node_selector`: Must match your node's availability zone

5. In `scenarios.yaml`:
- Enable/disable specific test scenarios as needed
- Adjust scenario parameters like pod counts and PVC limits

## Running Tests

Basic test with default parameters:
```
python run_tests.py
```

Run with custom duration (e.g., 2 hours):
```
python run_tests.py --duration 7200
```

Run with custom interval (seconds between operations):
```
python run_tests.py --interval 10
```

## Cleanup

To clean up resources created by tests:
```
python cleanup_test_resources.py
```

## Reports

Test reports are stored in:
- `reports/orchestrator/`: Orchestrator test reports (JSON)
- `reports/general/`: General test summary reports

## Architecture

- `tests/orchestrator.py`: Main test orchestration engine
- `utils/metrics_collector.py`: Collects performance metrics
- `utils/report_generator.py`: Generates test reports
- `run_tests.py`: CLI for running tests
- `cleanup_test_resources.py`: Utility for cleaning up test resources

## Notes

- The tests use `kubectl` subprocess calls for pod exec operations to avoid WebSocket protocol issues
- All tests run in the namespace specified in the config (default: `efs-stress-test`)
# AWS EFS CSI Driver Testing Framework
Loading